@@ -37,9 +37,7 @@ const ANDROID_ROWS = Array.from({ length: 24 }, (_, index) => ({
3737
3838test ( 'runtime snapshot warns when Android freshness retries still return the previous route' , async ( ) => {
3939 const device = snapshotDevice ( {
40- nodes : ANDROID_ROWS ,
41- truncated : false ,
42- backend : 'android' ,
40+ snapshot : makeSnapshotState ( ANDROID_ROWS , { truncated : false , backend : 'android' } ) ,
4341 freshness : {
4442 action : 'press' ,
4543 retryCount : 3 ,
@@ -58,9 +56,7 @@ test('runtime diff snapshot carries the stale-route warning for recent Android p
5856 baseline . createdAt = 1_000 ;
5957 const device = snapshotDevice (
6058 {
61- nodes : ANDROID_ROWS ,
62- truncated : false ,
63- backend : 'android' ,
59+ snapshot : makeSnapshotState ( ANDROID_ROWS , { truncated : false , backend : 'android' } ) ,
6460 freshness : {
6561 action : 'press' ,
6662 retryCount : 3 ,
@@ -78,9 +74,7 @@ test('runtime diff snapshot carries the stale-route warning for recent Android p
7874
7975test ( 'runtime snapshot raises no stale-route warning once the freshness retries succeeded' , async ( ) => {
8076 const device = snapshotDevice ( {
81- nodes : ANDROID_ROWS ,
82- truncated : false ,
83- backend : 'android' ,
77+ snapshot : makeSnapshotState ( ANDROID_ROWS , { truncated : false , backend : 'android' } ) ,
8478 freshness : { action : 'press' , retryCount : 1 , staleAfterRetries : false } ,
8579 } ) ;
8680
@@ -106,16 +100,17 @@ test.each([
106100 previous . presentationKey = buildSnapshotPresentationKey ( { interactiveOnly : interactive } ) ;
107101 const device = snapshotDevice (
108102 {
109- nodes : Array . from ( { length : 8 } , ( _ , index ) => ( {
110- ref : `e${ index + 1 } ` ,
111- index,
112- depth : 0 ,
113- type : 'android.widget.Button' ,
114- label : `Action ${ index + 1 } ` ,
115- hittable : true ,
116- } ) ) ,
117- truncated : false ,
118- backend : 'android' ,
103+ snapshot : makeSnapshotState (
104+ Array . from ( { length : 8 } , ( _ , index ) => ( {
105+ ref : `e${ index + 1 } ` ,
106+ index,
107+ depth : 0 ,
108+ type : 'android.widget.Button' ,
109+ label : `Action ${ index + 1 } ` ,
110+ hittable : true ,
111+ } ) ) ,
112+ { truncated : false , backend : 'android' } ,
113+ ) ,
119114 } ,
120115 { name : 'default' , snapshot : previous } ,
121116 ) ;
@@ -130,29 +125,28 @@ test.each([
130125
131126test ( 'runtime snapshot reports normalized visibility metadata for scroll-hidden content' , async ( ) => {
132127 const device = snapshotDevice ( {
133- nodes : [
134- {
135- ref : 'e1' ,
136- index : 0 ,
137- depth : 0 ,
138- type : 'android.widget.ScrollView' ,
139- label : 'Messages' ,
140- rect : { x : 0 , y : 100 , width : 390 , height : 500 } ,
141- hiddenContentBelow : true ,
142- } ,
143- {
144- ref : 'e2' ,
145- index : 1 ,
146- depth : 1 ,
147- parentIndex : 0 ,
148- type : 'android.widget.Button' ,
149- label : 'Visible message' ,
150- rect : { x : 0 , y : 140 , width : 390 , height : 48 } ,
151- hittable : true ,
152- } ,
153- ] ,
154- truncated : false ,
155- backend : 'android' ,
128+ snapshot : makeSnapshotState (
129+ [
130+ {
131+ index : 0 ,
132+ depth : 0 ,
133+ type : 'android.widget.ScrollView' ,
134+ label : 'Messages' ,
135+ rect : { x : 0 , y : 100 , width : 390 , height : 500 } ,
136+ hiddenContentBelow : true ,
137+ } ,
138+ {
139+ index : 1 ,
140+ depth : 1 ,
141+ parentIndex : 0 ,
142+ type : 'android.widget.Button' ,
143+ label : 'Visible message' ,
144+ rect : { x : 0 , y : 140 , width : 390 , height : 48 } ,
145+ hittable : true ,
146+ } ,
147+ ] ,
148+ { truncated : false , backend : 'android' } ,
149+ ) ,
156150 analysis : { rawNodeCount : 2 , maxDepth : 1 } ,
157151 } ) ;
158152
0 commit comments