Skip to content

Commit a31e682

Browse files
committed
test(snapshot): prove the empty-screen case each producer can answer (#3182)
The issue's second Done-when line is a capture of an empty screen that still reports the box. On the provider acquisition seam that is now a test: the fold runs with no nodes and the reported viewport still reaches the result.
1 parent 8a1ee64 commit a31e682

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

‎packages/capture-kit/src/snapshot/__tests__/ios-snapshot-runtime-viewport.test.ts‎

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,3 +66,19 @@ test('a regular acquisition with no viewport evidence still refuses rather than
6666
(error: unknown) => error instanceof AppError && error.code === 'COMMAND_FAILED',
6767
);
6868
});
69+
70+
// The issue's second Done-when line: an empty screen still reports the box. The box is a property of
71+
// the surface the producer read, so a tree that names nothing on it still answers the question.
72+
test('an empty iOS acquisition still publishes the viewport it read (#3182)', () => {
73+
const empty = createIosSnapshotAcquisition({
74+
producer: 'appium-source',
75+
nodes: [],
76+
viewport: { kind: 'reported', rect: SCREEN },
77+
lineage: { targetId: 'sim-1:com.example.app' },
78+
});
79+
80+
const presented = presentIosSnapshotAcquisition(empty);
81+
82+
assert.deepEqual(presented.nodes, []);
83+
assert.deepEqual(presented.viewport, { width: 390, height: 844 });
84+
});

0 commit comments

Comments
 (0)