@@ -34,6 +34,8 @@ describe('userEvent.press with real timers', () => {
3434 ) ;
3535
3636 await user . press ( screen . getByTestId ( 'pressable' ) ) ;
37+ // Typical event order is pressIn, pressOut, press
38+ // But sometimes due to a race condition, the order is pressIn, press, pressOut.
3739 const eventSequence = getEventsNames ( events ) . join ( ', ' ) ;
3840 expect (
3941 eventSequence === 'pressIn, pressOut, press' || eventSequence === 'pressIn, press, pressOut' ,
@@ -201,11 +203,11 @@ describe('userEvent.press with real timers', () => {
201203 ) ;
202204 await user . press ( screen . getByTestId ( 'pressable' ) ) ;
203205
204- const eventsNames = getEventsNames ( events ) . join ( ', ' ) ;
206+ const eventSequence = getEventsNames ( events ) . join ( ', ' ) ;
205207 // Typical event order is pressIn, pressOut, press
206208 // But sometimes due to a race condition, the order is pressIn, press, pressOut.
207209 expect (
208- eventsNames === 'pressIn, pressOut, press' || eventsNames === 'pressIn, press, pressOut' ,
210+ eventSequence === 'pressIn, pressOut, press' || eventSequence === 'pressIn, press, pressOut' ,
209211 ) . toBe ( true ) ;
210212 } ) ;
211213
0 commit comments