@@ -6,7 +6,11 @@ import type { RawSnapshotNode } from '@agent-device/kernel/snapshot';
66import type { IosSystemSurfaceProvenance } from '@agent-device/contracts/ios-system-surface' ;
77import type { AppleRunnerSnapshotResult } from './snapshot-presentation.ts' ;
88import { presentAppleRunnerSnapshot , readAppleSnapshotResult } from './snapshot-presentation.ts' ;
9- import { assertSnapshotScreenOrigin } from '@agent-device/contracts/capture' ;
9+ import {
10+ assertSnapshotScreenOrigin ,
11+ attachSnapshotViewportEvidence ,
12+ copySnapshotViewportEvidence ,
13+ } from '@agent-device/contracts/capture' ;
1014
1115const NO_VIEWPORT_ROOT = { index : 0 , type : 'Application' , label : 'App' } ;
1216
@@ -87,9 +91,21 @@ test('reported runner viewport retains screen authority through the wire reader
8791 } ,
8892 IOS_SIMULATOR ,
8993 ) ;
94+ assert . deepEqual ( read . viewportEvidence , { kind : 'reported' , rect } ) ;
9095 const presented = presentAppleRunnerSnapshot ( 'device-1' , undefined , read ) ;
9196 assert . deepEqual ( presented . viewport , { width : 551 , height : 813 } ) ;
92- await assert . doesNotReject ( assertSnapshotScreenOrigin ( presented . nodes , 'Captured action' ) ) ;
97+ assert . deepEqual ( presented . nodes . find ( ( node ) => node . identifier === 'action' ) ?. rect , {
98+ x : 481 ,
99+ y : 314 ,
100+ width : 220 ,
101+ height : 42 ,
102+ } ) ;
103+ const priorUnknown = attachSnapshotViewportEvidence ( [ ] , {
104+ kind : 'missing' ,
105+ reason : 'not-provided' ,
106+ } ) ;
107+ copySnapshotViewportEvidence ( presented . nodes , priorUnknown ) ;
108+ await assert . doesNotReject ( assertSnapshotScreenOrigin ( priorUnknown , 'Captured action' ) ) ;
93109} ) ;
94110
95111function presentSparse ( overrides : Partial < AppleRunnerSnapshotResult > = { } ) {
0 commit comments