@@ -2602,46 +2602,42 @@ describe('splat routes with empty splat', () => {
26022602 'splat-btn-with-empty-splat' ,
26032603 )
26042604
2605- await waitFor ( ( ) => {
2606- fireEvent . click ( splatBtnWithEmptySplat )
2607- } )
2605+ fireEvent . click ( splatBtnWithEmptySplat )
26082606
2609- expect ( window . location . pathname ) . toBe ( `/splat${ tail } ` )
2610- expect ( await screen . findByText ( 'Splat Route' ) ) . toBeInTheDocument ( )
2607+ await waitFor ( async ( ) => {
2608+ expect ( window . location . pathname ) . toBe ( `/splat${ tail } ` )
2609+ expect ( await screen . findByText ( 'Splat Route' ) ) . toBeInTheDocument ( )
2610+ } )
26112611
26122612 // Navigate back to index
2613- await waitFor ( ( ) => {
2614- history . push ( '/' )
2615- } )
2613+ history . push ( '/' )
26162614
26172615 // Navigate with undefined _splat
26182616 const splatBtnWithUndefinedSplat = await screen . findByTestId (
26192617 'splat-btn-with-undefined-splat' ,
26202618 )
26212619
2622- await waitFor ( ( ) => {
2623- fireEvent . click ( splatBtnWithUndefinedSplat )
2624- } )
2620+ fireEvent . click ( splatBtnWithUndefinedSplat )
26252621
2626- expect ( window . location . pathname ) . toBe ( `/splat${ tail } ` )
2627- expect ( await screen . findByText ( 'Splat Route' ) ) . toBeInTheDocument ( )
2622+ await waitFor ( async ( ) => {
2623+ expect ( window . location . pathname ) . toBe ( `/splat${ tail } ` )
2624+ expect ( await screen . findByText ( 'Splat Route' ) ) . toBeInTheDocument ( )
2625+ } )
26282626
26292627 // Navigate back to index
2630- await waitFor ( ( ) => {
2631- history . push ( '/' )
2632- } )
2628+ history . push ( '/' )
26332629
26342630 // Navigate with no _splat
26352631 const splatBtnWithNoSplat = await screen . findByTestId (
26362632 'splat-btn-with-no-splat' ,
26372633 )
26382634
2639- await waitFor ( ( ) => {
2640- fireEvent . click ( splatBtnWithNoSplat )
2641- } )
2635+ fireEvent . click ( splatBtnWithNoSplat )
26422636
2643- expect ( window . location . pathname ) . toBe ( `/splat${ tail } ` )
2644- expect ( await screen . findByText ( 'Splat Route' ) ) . toBeInTheDocument ( )
2637+ await waitFor ( async ( ) => {
2638+ expect ( window . location . pathname ) . toBe ( `/splat${ tail } ` )
2639+ expect ( await screen . findByText ( 'Splat Route' ) ) . toBeInTheDocument ( )
2640+ } )
26452641 } ,
26462642 )
26472643} )
0 commit comments