File tree 1 file changed +16
-1
lines changed
1 file changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -13,12 +13,27 @@ const routes = [
13
13
14
14
test ( 'full app rendering/navigating' , async ( ) => {
15
15
// Notice how we pass a `routes` object to our render function.
16
- const { getByTestId} = render ( App , { routes} )
16
+ const { getByTestId, getByText } = render ( App , { routes} )
17
17
18
+ expect ( getByText ( / y o u a r e h o m e / i) ) . toBeInTheDocument ( )
18
19
expect ( getByTestId ( 'location-display' ) ) . toHaveTextContent ( '/' )
19
20
20
21
await fireEvent . click ( getByTestId ( 'about-link' ) )
21
22
23
+ expect ( getByText ( / y o u a r e o n t h e a b o u t p a g e / i) ) . toBeInTheDocument ( )
24
+ expect ( getByTestId ( 'location-display' ) ) . toHaveTextContent ( '/about' )
25
+ } )
26
+
27
+ test ( 'another app rendering/navigating' , async ( ) => {
28
+ // Notice how we pass a `routes` object to our render function.
29
+ const { getByTestId, getByText} = render ( App , { routes} )
30
+
31
+ expect ( getByText ( / y o u a r e h o m e / i) ) . toBeInTheDocument ( )
32
+ expect ( getByTestId ( 'location-display' ) ) . toHaveTextContent ( '/' )
33
+
34
+ await fireEvent . click ( getByTestId ( 'about-link' ) )
35
+
36
+ expect ( getByText ( / y o u a r e o n t h e a b o u t p a g e / i) ) . toBeInTheDocument ( )
22
37
expect ( getByTestId ( 'location-display' ) ) . toHaveTextContent ( '/about' )
23
38
} )
24
39
You can’t perform that action at this time.
0 commit comments