Skip to content

Commit 17956a5

Browse files
committed
test(selectors): use a declared snapshot quality state in the capture fixtures
1 parent a4ff238 commit 17956a5

1 file changed

Lines changed: 14 additions & 4 deletions

File tree

packages/selectors/src/scroll-until-match.test.ts

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -118,15 +118,25 @@ test('the legacy iOS application-root-only shape is refused', async () => {
118118
});
119119

120120
/**
121-
* Truncation is a readable tree missing its tail, not a failed read. Refusing it would fail large
121+
* A tree the backend vouches for is readable, and so is one whose tail was truncated: truncation
122+
* drops content, it does not make the capture untrustworthy. Refusing either would fail large
122123
* screens where the target is plainly in view.
123124
*/
124-
test('a truncated but populated capture is not refused', async () => {
125+
test('a populated capture is not refused, healthy or recovered', async () => {
126+
const nodes = tree({ ref: 'e2', label: 'Submit', y: 200 });
125127
assert.equal(
126128
await scrollUntilCaptureRefusal({
127-
nodes: tree({ ref: 'e2', label: 'Submit', y: 200 }),
128-
snapshotQuality: { state: 'ok', backend: 'tree' },
129+
nodes,
130+
snapshotQuality: { state: 'healthy', backend: 'tree' },
131+
}),
132+
undefined,
133+
);
134+
assert.equal(
135+
await scrollUntilCaptureRefusal({
136+
nodes,
137+
snapshotQuality: { state: 'recovered', backend: 'tree' },
129138
}),
130139
undefined,
131140
);
141+
assert.equal(await scrollUntilCaptureRefusal({ nodes }), undefined);
132142
});

0 commit comments

Comments
 (0)