File tree Expand file tree Collapse file tree 2 files changed +8
-4
lines changed
react-router-dom/__tests__ Expand file tree Collapse file tree 2 files changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -29,7 +29,6 @@ import {
29
29
useFetchers ,
30
30
useLoaderData ,
31
31
useLocation ,
32
- useMatches ,
33
32
useNavigate ,
34
33
useNavigation ,
35
34
useRouteError ,
@@ -5821,7 +5820,12 @@ function testDomRouter(
5821
5820
Component ( ) {
5822
5821
let fetcher = useFetcher ( { key : "me" } ) ;
5823
5822
let data = useLoaderData ( ) as { count : number } ;
5824
- return < h1 > { `Page (${ data . count } )` } </ h1 > ;
5823
+ return (
5824
+ < >
5825
+ < h1 > { `Page (${ data . count } )` } </ h1 >
5826
+ < p > { fetcher . data } </ p >
5827
+ </ >
5828
+ ) ;
5825
5829
} ,
5826
5830
async loader ( ) {
5827
5831
await new Promise ( ( r ) => setTimeout ( r , 10 ) ) ;
@@ -5853,6 +5857,7 @@ function testDomRouter(
5853
5857
dfd . resolve ( "FETCH" ) ;
5854
5858
await waitFor ( ( ) => screen . getByText ( "Num fetchers: 0" ) ) ;
5855
5859
expect ( getHtml ( container ) ) . toMatch ( "Page (2)" ) ;
5860
+ expect ( getHtml ( container ) ) . toMatch ( "FETCH" ) ;
5856
5861
} ) ;
5857
5862
5858
5863
it ( "submitting fetchers w/redirects are cleaned up on completion" , async ( ) => {
Original file line number Diff line number Diff line change 1
- import { IDLE_NAVIGATION } from "../router" ;
2
1
import { cleanup , setup } from "./utils/data-router-setup" ;
3
- import { createFormData , tick } from "./utils/utils" ;
2
+ import { createFormData } from "./utils/utils" ;
4
3
5
4
describe ( "flushSync" , ( ) => {
6
5
// Detect any failures inside the router navigate code
You can’t perform that action at this time.
0 commit comments