File tree Expand file tree Collapse file tree
packages/react-router/tests Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -914,23 +914,29 @@ test('reproducer for #6388 - rapid navigation between parameterized routes shoul
914914 render ( < RouterProvider router = { router } /> )
915915 await act ( ( ) => router . latestLoadPromise )
916916
917+ const pendingComponent = screen . findByTestId ( 'pending-component' )
917918 expect ( await screen . findByTestId ( 'home-page' ) ) . toBeInTheDocument ( )
918919
919920 const param1Link = await screen . findByTestId ( 'link-to-param-1' )
920921 fireEvent . click ( param1Link )
922+ expect ( await pendingComponent ) . toBeInTheDocument ( )
921923
922924 const param2Link = await screen . findByTestId ( 'link-to-param-2' )
923925 fireEvent . click ( param2Link )
926+ expect ( await pendingComponent ) . toBeInTheDocument ( )
924927
925928 fireEvent . click ( param1Link )
929+ expect ( await pendingComponent ) . toBeInTheDocument ( )
926930
927931 await act ( ( ) => router . latestLoadPromise )
928932
929933 expect ( onAbortMock ) . toHaveBeenCalled ( )
930934 expect ( errorComponentRenderCount ) . not . toHaveBeenCalled ( )
931935 expect ( screen . queryByTestId ( 'error-component' ) ) . not . toBeInTheDocument ( )
936+ expect ( await pendingComponent ) . not . toBeInTheDocument ( )
932937
933938 const paramPage = await screen . findByTestId ( 'param-page' )
934939 expect ( paramPage ) . toBeInTheDocument ( )
940+ expect ( paramPage ) . toHaveTextContent ( 'Param Component 1 Done' )
935941 expect ( loaderCompleteMock ) . toHaveBeenCalled ( )
936942} )
You can’t perform that action at this time.
0 commit comments