File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -116,20 +116,19 @@ it("opening a thread or returning to the window on a touch tablet does not focus
116116 const router = getRouter (
117117 createMemoryHistory ( { initialEntries : [ `/${ ENVIRONMENT_ID } /${ first . id } ` ] } ) ,
118118 ) ;
119- // Fake frames hold each thread entry's focus frame until the test advances it.
120- using _timers = fakeTimers ( ) ;
121119 await using _app = await openAtTabletSize ( router ) ;
122120 const composer = page . getByTestId ( "composer-editor" ) ;
123-
124- // Focusing the editor raises the on-screen keyboard, which shrinks the page on iPadOS.
125121 await expect . element ( page . getByText ( `Answer 0 for ${ first . id } .` ) ) . toBeVisible ( ) ;
126- await expect . element ( composer ) . toBeVisible ( ) ;
127- vi . advanceTimersToNextFrame ( ) ;
128- expect ( document . activeElement ) . not . toBe ( composer . element ( ) ) ;
129122
123+ // Fake frames hold the next thread entry's focus frame until the test advances it.
124+ using _timers = fakeTimers ( ) ;
130125 // The shell subscription outlives each render, so the sidebar lists only the first test's threads.
131126 router . history . push ( `/${ ENVIRONMENT_ID } /${ second . id } ` ) ;
132127 await expect . element ( page . getByText ( `Answer 0 for ${ second . id } .` ) ) . toBeVisible ( ) ;
128+ vi . advanceTimersToNextFrame ( ) ;
129+ // Focusing the editor raises the on-screen keyboard, which shrinks the page on iPadOS.
130+ expect ( document . activeElement ) . not . toBe ( composer . element ( ) ) ;
131+
133132 returnToWindow ( ) ;
134133 expect ( document . activeElement ) . not . toBe ( composer . element ( ) ) ;
135134} ) ;
You can’t perform that action at this time.
0 commit comments