Skip to content

Commit 1a6a927

Browse files
committed
component render tests running on MainContainer and DashboardContainer, need to expand MainContainer tests for context data
1 parent 52c3121 commit 1a6a927

3 files changed

Lines changed: 77 additions & 6 deletions

File tree

Lines changed: 38 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,39 @@
1-
xdescribe('<DashboardContainer />', () => {
2-
it('should render <SidebarContainer />');
3-
it('should render <MainContainer />');
4-
it('should render all of the contexts');
1+
import React from 'react';
2+
import { configure, shallow, render } from 'enzyme';
3+
// import Adapter from 'enzyme-adapter-react-16';
4+
// import renderer from 'react-test-renderer';
5+
// import { expect } from 'chai';
6+
import DashboardContainer from '../../../app/containers/DashboardContainer';
7+
import MainContainer from '../../../app/containers/MainContainer'
8+
import SidebarContainer from '../../../app/containers/SidebarContainer'
9+
import ApplicationContextProvider from '../../../app/context/ApplicationContext'
10+
// configure({ adapter: new Adapter() });
11+
12+
describe('<DashboardContainer />', () => {
13+
it(' renders component Maincontainer ', () => {
14+
const wrapper = shallow(<DashboardContainer />);
15+
16+
expect(wrapper.contains(<MainContainer />)).toBe(true);
17+
expect(wrapper.contains(<SidebarContainer />)).toBe(true);
18+
});
19+
20+
it(' renders component SidebarContainer', () => {
21+
const wrapper = shallow(<DashboardContainer />);
22+
23+
expect(wrapper.contains(<SidebarContainer />)).toBe(true);
24+
});
25+
// it(' renders component SidebarContainer', () => {
26+
// const wrapper = shallow(<DashboardContainer />);
27+
28+
// expect(wrapper.contains( <ApplicationContextProvider></ApplicationContextProvider>)).toBe(true);
29+
// });
30+
531
});
32+
33+
34+
35+
// describe('<DashboardContainer />', () => {
36+
// it('should render <SidebarContainer />');
37+
// it('should render <MainContainer />');
38+
// it('should render all of the contexts');
39+
// });
Lines changed: 38 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,39 @@
1-
xdescribe('<MainContainer />', () => {
2-
it('should');
1+
import React from 'react';
2+
import { configure, shallow, render } from 'enzyme';
3+
import { Route, Switch } from 'react-router-dom';
4+
5+
6+
import MainContainer from '../../../app/containers/MainContainer'
7+
import Home from '../../../app/components/Home'
8+
import Copyright from '../../../app/components/Copyright'
9+
import Occupied from '../../../app/components/Occupied'
10+
import GraphsContainer from '../../../app/containers/GraphsContainer'
11+
12+
describe('<MainContainer />', () => {
13+
it(' renders component Home', () => {
14+
const wrapper = shallow(<MainContainer />);
15+
16+
expect(wrapper.contains(<Route exact path="/" component={Home} />)).toBe(true);
17+
});
18+
it('renders component Copyright', () => {
19+
const wrapper = shallow (<MainContainer />);
20+
21+
expect(wrapper.contains(<Copyright />)).toBe(true);
22+
23+
})
24+
it('renders component Occupied', () => {
25+
const wrapper = shallow (<MainContainer />);
26+
27+
expect(wrapper.contains(<Route exact path="/applications" component={Occupied} />)).toBe(true);
28+
29+
})
30+
it('renders container GraphsContainer', () => {
31+
const wrapper = shallow (<MainContainer />);
32+
33+
expect(wrapper.contains(<Route exact path="/applications/:app/:service" component={GraphsContainer} />)).toBe(true);
34+
35+
})
36+
337
});
38+
39+

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
"@jest-runner/electron": "^2.0.3",
3636
"@material-ui/core": "^4.11.0",
3737
"@material-ui/icons": "^4.9.1",
38+
"@types/react-test-renderer": "^16.9.2",
3839
"chart.js": "^2.8.0",
3940
"d3": "^5.16.0",
4041
"electron": "^6.1.11",

0 commit comments

Comments
 (0)