|
1 | 1 | import React from 'react'; |
2 | 2 | import { configure, shallow, render } from 'enzyme'; |
3 | 3 |
|
| 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'; |
4 | 8 | import SidebarContainer from '../../../app/containers/SidebarContainer' |
5 | 9 | import { Link } from 'react-router-dom'; |
6 | 10 |
|
7 | 11 |
|
8 | 12 | describe('<SidebarContainer />', () => { |
9 | 13 | it('should render an <img> tag with the Chronos logo', () => { |
10 | 14 | const wrapper = shallow(<SidebarContainer />); |
11 | | - |
| 15 | + console.log(wrapper.debug) |
12 | 16 | expect(wrapper.contains(<img alt="Chronos Logo" id="serviceDashLogo" src="../assets/icon2Cropped.png" />)).toBe(true); |
13 | 17 | }); |
14 | 18 | it("should render a <Link /> with the label as 'Home'", () => { |
15 | 19 | const wrapper = shallow(<SidebarContainer />); |
16 | 20 |
|
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 | +  Home |
19 | 24 | </Link>)).toBe(true) |
20 | 25 | }); |
21 | 26 | it("should render a <Link /> with the label as 'About'", () => { |
22 | 27 | const wrapper = shallow(<SidebarContainer />); |
23 | 28 |
|
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 | +  About |
26 | 32 | </Link>)).toBe(true) |
27 | 33 | }); |
28 | 34 | it("should render a <Link /> with the label as 'Contact'", () => { |
29 | 35 | const wrapper = shallow(<SidebarContainer />); |
30 | 36 |
|
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 | +  Contact |
33 | 40 | </Link>)).toBe(true) |
34 | 41 | }); |
35 | 42 | it("should render a <Link /> with the label as 'Settings'", () => { |
36 | 43 | const wrapper = shallow(<SidebarContainer />); |
37 | 44 |
|
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 | +  Settings |
40 | 48 | </Link>)).toBe(true) |
41 | 49 | }); |
42 | 50 |
|
|
0 commit comments