Skip to content

Commit 0818ed2

Browse files
committed
update Sidebar component rendering tests to reflect updates to links
1 parent 711b625 commit 0818ed2

1 file changed

Lines changed: 17 additions & 9 deletions

File tree

__tests__/app/containers/SidebarContainer.test.tsx

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,50 @@
11
import React from 'react';
22
import { configure, shallow, render } from 'enzyme';
33

4+
import HomeSharpIcon from '@material-ui/icons/HomeSharp';
5+
import InfoIcon from '@material-ui/icons/Info';
6+
import ContactSupportIcon from '@material-ui/icons/ContactSupport';
7+
import SettingsIcon from '@material-ui/icons/Settings';
48
import SidebarContainer from '../../../app/containers/SidebarContainer'
59
import { Link } from 'react-router-dom';
610

711

812
describe('<SidebarContainer />', () => {
913
it('should render an <img> tag with the Chronos logo', () => {
1014
const wrapper = shallow(<SidebarContainer />);
11-
15+
console.log(wrapper.debug)
1216
expect(wrapper.contains(<img alt="Chronos Logo" id="serviceDashLogo" src="../assets/icon2Cropped.png" />)).toBe(true);
1317
});
1418
it("should render a <Link /> with the label as 'Home'", () => {
1519
const wrapper = shallow(<SidebarContainer />);
1620

17-
expect(wrapper.contains(<Link className="sidebar-link" to="/">
18-
Home
21+
expect(wrapper.contains(<Link className="sidebar-link" to="/" id="home">
22+
<HomeSharpIcon style={{ boxShadow: 'none', width: '40px', height: '40px' }} />
23+
&emsp;Home
1924
</Link>)).toBe(true)
2025
});
2126
it("should render a <Link /> with the label as 'About'", () => {
2227
const wrapper = shallow(<SidebarContainer />);
2328

24-
expect(wrapper.contains(<Link className="sidebar-link" to="/">
25-
About
29+
expect(wrapper.contains(<Link className="sidebar-link" to="/about" id="about">
30+
<InfoIcon style={{ boxShadow: 'none', width: '40px', height: '40px' }} />
31+
&emsp;About
2632
</Link>)).toBe(true)
2733
});
2834
it("should render a <Link /> with the label as 'Contact'", () => {
2935
const wrapper = shallow(<SidebarContainer />);
3036

31-
expect(wrapper.contains(<Link className="sidebar-link" to="/">
32-
Contact
37+
expect(wrapper.contains(<Link className="sidebar-link" to="/contact" id="contact">
38+
<ContactSupportIcon style={{ boxShadow: 'none', width: '40px', height: '40px' }} />
39+
&emsp;Contact
3340
</Link>)).toBe(true)
3441
});
3542
it("should render a <Link /> with the label as 'Settings'", () => {
3643
const wrapper = shallow(<SidebarContainer />);
3744

38-
expect(wrapper.contains(<Link className="sidebar-link" to="/">
39-
Settings
45+
expect(wrapper.contains(<Link className="sidebar-link" to="/settings" id="settings">
46+
<SettingsIcon style={{ boxShadow: 'none', width: '40px', height: '40px' }} />
47+
&emsp;Settings
4048
</Link>)).toBe(true)
4149
});
4250

0 commit comments

Comments
 (0)