File tree Expand file tree Collapse file tree 1 file changed +8
-14
lines changed
front/src/pages/login/__tests__ Expand file tree Collapse file tree 1 file changed +8
-14
lines changed Original file line number Diff line number Diff line change 1- // @flow
2-
3- // #region imports
41import React from 'react' ;
5- import renderer from 'react-test-renderer' ; // needed both for snpashot testing but also to prevent errors from enzyme
2+ import { shallow } from ' enzyme' ;
63import { MemoryRouter } from 'react-router' ;
74import Login from '../Login' ;
8- // #endregion
95
106describe ( 'Login page' , ( ) => {
117 it ( 'renders as expected' , ( ) => {
@@ -16,15 +12,13 @@ describe('Login page', () => {
1612 checkIsAuthenticated : ( ) => { } ,
1713 } ;
1814
19- const component = renderer
20- . create (
21- < div >
22- < MemoryRouter >
23- < Login { ...props } />
24- </ MemoryRouter >
25- </ div > ,
26- )
27- . toJSON ( ) ;
15+ const component = shallow (
16+ < div >
17+ < MemoryRouter >
18+ < Login { ...props } />
19+ </ MemoryRouter >
20+ </ div > ,
21+ ) ;
2822 expect ( component ) . toMatchSnapshot ( ) ;
2923 } ) ;
3024} ) ;
You can’t perform that action at this time.
0 commit comments