Skip to content

Commit 7c4ad8f

Browse files
committed
Resolving travis error [2]
1 parent a7ff405 commit 7c4ad8f

File tree

3 files changed

+48
-61
lines changed

3 files changed

+48
-61
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,27 @@
11
// Jest Snapshot v1, https://goo.gl/fbAQLP
22

33
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"
1915
>
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>
3624
</div>
37-
</Home>
38-
</Provider>
25+
</div>
26+
</Home>
3927
`;

src/tests/components/home.test.js

+11-15
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,14 @@
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";
66

7-
describe('*************** Testing the Home component ***************',()=>{
8-
const store = configureStore();
7+
describe("*************** Testing the Home component ***************", () => {
8+
const store = configureStore();
99

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+
});
1814
});

src/tests/routes.test.js

+16-13
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,18 @@
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();
58

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+
});
1518
});

0 commit comments

Comments
 (0)