File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -158,6 +158,33 @@ test('invokeMaestroAssertVisible uses snapshot resolution for short iOS assertio
158158 assert . deepEqual ( calls , [ [ 'snapshot' , [ ] ] ] ) ;
159159} ) ;
160160
161+ test ( 'invokeMaestroAssertVisible treats an elapsed ellipsis loading gate as already past loading' , async ( ) => {
162+ vi . spyOn ( Date , 'now' ) . mockReturnValueOnce ( 0 ) . mockReturnValueOnce ( 0 ) . mockReturnValueOnce ( 250 ) ;
163+
164+ const response = await invokeMaestroAssertVisible ( {
165+ baseReq : {
166+ token : 't' ,
167+ session : 's' ,
168+ flags : {
169+ platform : 'ios' ,
170+ maestro : { allowAlreadyPastLoading : true } ,
171+ } ,
172+ } ,
173+ positionals : [ 'label="Loading…" || text="Loading…" || id="Loading…"' , '1000' ] ,
174+ invoke : async ( ) : Promise < DaemonResponse > => ( {
175+ ok : true ,
176+ data : snapshot ( [ node ( 'Dashboard' ) ] ) ,
177+ } ) ,
178+ } ) ;
179+
180+ assert . equal ( response . ok , true ) ;
181+ if ( response . ok ) {
182+ assert . ok ( response . data ) ;
183+ assert . equal ( response . data . alreadyPastLoading , true ) ;
184+ assert . equal ( response . data . waitedMs , 250 ) ;
185+ }
186+ } ) ;
187+
161188test ( 'invokeMaestroAssertVisible dismisses React Native overlays during snapshot assertions' , async ( ) => {
162189 const calls : Array < [ string , string [ ] | undefined ] > = [ ] ;
163190 let snapshots = 0 ;
Original file line number Diff line number Diff line change @@ -373,12 +373,12 @@ function normalizeLoadingText(value: string | null | undefined): string {
373373 value
374374 ?. trim ( )
375375 . toLowerCase ( )
376- . replace ( / \. \. \. / g, '...' ) ?? ''
376+ . replace ( / \u2026 / g, '...' ) ?? ''
377377 ) ;
378378}
379379
380380function isLoadingText ( value : string ) : boolean {
381- return value === 'loading' || value === 'loading...' || value === 'loading…' ;
381+ return value === 'loading' || value === 'loading...' ;
382382}
383383
384384function visibleAssertionResponse (
You can’t perform that action at this time.
0 commit comments