1- import { Router } from '@solidjs/router' ;
1+ import { Route , Router } from '@solidjs/router' ;
22// eslint-disable-next-line import/no-extraneous-dependencies
33import { render , screen } from '@solidjs/testing-library' ;
44import { expect , describe , test } from 'vitest' ;
@@ -9,15 +9,29 @@ describe('Footer component', () => {
99 test ( 'should has copyright text' , ( ) => {
1010 // const result = render(() => <Footer />);
1111 render ( ( ) => < Footer /> , {
12- wrapper : props => < Router > { props . children } </ Router > ,
12+ wrapper : props => (
13+ < Router
14+ // eslint-disable-next-line @typescript-eslint/no-shadow
15+ root = { props => < > { props . children } </ > }
16+ >
17+ < Route path = "/" component = { ( ) => < > { props . children } </ > } />
18+ </ Router >
19+ ) ,
1320 } ) ;
1421 const copyElm = screen . getByText ( / ^ © C o p y r i g h t $ / i) ; // full string match, ignore case
1522 expect ( copyElm ) . toBeInTheDocument ( ) ;
1623 } ) ;
1724
1825 test ( 'should has classes' , async ( ) => {
1926 render ( ( ) => < Footer /> , {
20- wrapper : props => < Router > { props . children } </ Router > ,
27+ wrapper : props => (
28+ < Router
29+ // eslint-disable-next-line @typescript-eslint/no-shadow
30+ root = { props => < > { props . children } </ > }
31+ >
32+ < Route path = "/" component = { ( ) => < > { props . children } </ > } />
33+ </ Router >
34+ ) ,
2135 } ) ;
2236 const footerElm = screen . getByRole ( 'contentinfo' , { name : '' } ) ;
2337 await expect ( footerElm ) . toHaveClass (
0 commit comments