@@ -36,10 +36,9 @@ describe('userEvent.press with real timers', () => {
3636 await user . press ( screen . getByTestId ( 'pressable' ) ) ;
3737 // Typical event order is pressIn, pressOut, press
3838 // But sometimes due to a race condition, the order is pressIn, press, pressOut.
39- const eventSequence = getEventsNames ( events ) . join ( ', ' ) ;
40- expect (
41- eventSequence === 'pressIn, pressOut, press' || eventSequence === 'pressIn, press, pressOut' ,
42- ) . toBe ( true ) ;
39+ expect ( [ 'pressIn,pressOut,press' , 'pressIn,press,pressOut' ] ) . toContain (
40+ getEventsNames ( events ) . join ( ',' ) ,
41+ ) ;
4342 } ) ;
4443
4544 test ( 'works on TouchableOpacity' , async ( ) => {
@@ -203,12 +202,11 @@ describe('userEvent.press with real timers', () => {
203202 ) ;
204203 await user . press ( screen . getByTestId ( 'pressable' ) ) ;
205204
206- const eventSequence = getEventsNames ( events ) . join ( ', ' ) ;
207205 // Typical event order is pressIn, pressOut, press
208206 // But sometimes due to a race condition, the order is pressIn, press, pressOut.
209- expect (
210- eventSequence === 'pressIn, pressOut, press' || eventSequence === 'pressIn, press, pressOut' ,
211- ) . toBe ( true ) ;
207+ expect ( [ 'pressIn,pressOut,press' , 'pressIn,press,pressOut' ] ) . toContain (
208+ getEventsNames ( events ) . join ( ',' ) ,
209+ ) ;
212210 } ) ;
213211
214212 test ( 'crawls up in the tree to find an element that responds to touch events' , async ( ) => {
0 commit comments