File tree 3 files changed +48
-61
lines changed
3 files changed +48
-61
lines changed Original file line number Diff line number Diff line change 1
1
// Jest Snapshot v1, https://goo.gl/fbAQLP
2
2
3
3
exports [` *************** Testing the Home component *************** Should render the Home page correctly 1` ] = `
4
- <Provider
5
- store = {
6
- Object {
7
- " dispatch" : [Function ],
8
- " getState" : [Function ],
9
- " replaceReducer" : [Function ],
10
- " subscribe" : [Function ],
11
- Symbol(Symbol .observable ): [Function ],
12
- }
13
- }
14
- >
15
- <Home >
16
- <div >
17
- <div
18
- className = " row"
4
+ <Home >
5
+ <div >
6
+ <div
7
+ className = " row"
8
+ >
9
+ <h1 >
10
+ BareFoot Nomad Welcomes You!!
11
+ </h1 >
12
+ <a
13
+ className = " waves-effect waves-light btn"
14
+ href = " /login"
19
15
>
20
- <h1 >
21
- BareFoot Nomad Welcomes You!!
22
- </h1 >
23
- <a
24
- className = " waves-effect waves-light btn"
25
- href = " /login"
26
- >
27
- Login
28
- </a >
29
- <a
30
- className = " waves-effect waves-light btn"
31
- href = " /signup"
32
- >
33
- Signup
34
- </a >
35
- </div >
16
+ Login
17
+ </a >
18
+ <a
19
+ className = " waves-effect waves-light btn"
20
+ href = " /signup"
21
+ >
22
+ Signup
23
+ </a >
36
24
</div >
37
- </Home >
38
- </Provider >
25
+ </div >
26
+ </Home >
39
27
` ;
Original file line number Diff line number Diff line change 1
- import React from ' react' ;
2
- import { mount } from ' enzyme' ;
3
- import { Provider } from ' react-redux' ;
4
- // import Home from ' ../../components/home' ;
5
- import configureStore from ' ../../redux/configureStore' ;
1
+ import React from " react" ;
2
+ import { mount } from " enzyme" ;
3
+ import { Provider } from " react-redux" ;
4
+ import Home from " ../../components/home" ;
5
+ import configureStore from " ../../redux/configureStore" ;
6
6
7
- describe ( ' *************** Testing the Home component ***************' , ( ) => {
8
- const store = configureStore ( ) ;
7
+ describe ( " *************** Testing the Home component ***************" , ( ) => {
8
+ const store = configureStore ( ) ;
9
9
10
- // it('Should render the Home page correctly', ()=>{
11
- // const wrapper = mount(
12
- // <Provider store={ store }>
13
- // <Home />
14
- // </Provider>
15
- // );
16
- // expect(wrapper).toMatchSnapshot();
17
- // });
10
+ it ( "Should render the Home page correctly" , ( ) => {
11
+ const wrapper = mount ( < Home /> ) ;
12
+ expect ( wrapper ) . toMatchSnapshot ( ) ;
13
+ } ) ;
18
14
} ) ;
Original file line number Diff line number Diff line change 1
- import React from 'react' ;
2
- import { MemoryRouter } from 'react-router-dom' ;
3
- import { mount } from 'enzyme' ;
4
- import App from '../App' ;
1
+ import React from "react" ;
2
+ import { MemoryRouter } from "react-router-dom" ;
3
+ import { shallow } from "enzyme" ;
4
+ import App from "../App" ;
5
+ import { Provider } from "react-redux" ;
6
+ import configureStore from "../redux/configureStore" ;
7
+ const store = configureStore ( ) ;
5
8
6
- describe ( ' app component' , ( ) => {
7
- test ( ' it should render the Home component' , ( ) => {
8
- const component = mount (
9
- < MemoryRouter initialEntries = { [ '/' ] } >
10
- { App }
11
- </ MemoryRouter >
12
- ) ;
13
- expect ( component ) . toHaveLength ( 1 ) ;
14
- } ) ;
9
+ describe ( " app component" , ( ) => {
10
+ test ( " it should render the Home component" , ( ) => {
11
+ const component = shallow (
12
+ < Provider store = { store } >
13
+ < App />
14
+ </ Provider >
15
+ ) ;
16
+ expect ( component ) . toHaveLength ( 1 ) ;
17
+ } ) ;
15
18
} ) ;
You can’t perform that action at this time.
0 commit comments