|
1 | | -xdescribe('<SidebarContainer />', () => { |
2 | | - it('should render an <img> tag with the Chronos logo'); |
3 | | - it("should render a <Link /> with the label as 'Home'"); |
4 | | - it("should render a <Link /> with the label as 'About'"); |
5 | | - it("should render a <Link /> with the label as 'Contact'"); |
6 | | - it("should render a <Link /> with the label as 'Settings'"); |
| 1 | +import React from 'react'; |
| 2 | +import { configure, shallow, render } from 'enzyme'; |
| 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'; |
| 8 | +import SidebarContainer from '../../../app/containers/SidebarContainer' |
| 9 | +import { Link } from 'react-router-dom'; |
| 10 | + |
| 11 | + |
| 12 | +describe('<SidebarContainer />', () => { |
| 13 | + it('should render an <img> tag with the Chronos logo', () => { |
| 14 | + const wrapper = shallow(<SidebarContainer />); |
| 15 | + console.log(wrapper.debug) |
| 16 | + expect(wrapper.contains(<img alt="Chronos Logo" id="serviceDashLogo" src="../assets/icon2Cropped.png" />)).toBe(true); |
| 17 | + }); |
| 18 | + it("should render a <Link /> with the label as 'Home'", () => { |
| 19 | + const wrapper = shallow(<SidebarContainer />); |
| 20 | + |
| 21 | + expect(wrapper.contains(<Link className="sidebar-link" to="/" id="home"> |
| 22 | + <HomeSharpIcon style={{ boxShadow: 'none', width: '40px', height: '40px' }} /> |
| 23 | +  Home |
| 24 | + </Link>)).toBe(true) |
| 25 | + }); |
| 26 | + it("should render a <Link /> with the label as 'About'", () => { |
| 27 | + const wrapper = shallow(<SidebarContainer />); |
| 28 | + |
| 29 | + expect(wrapper.contains(<Link className="sidebar-link" to="/about" id="about"> |
| 30 | + <InfoIcon style={{ boxShadow: 'none', width: '40px', height: '40px' }} /> |
| 31 | +  About |
| 32 | + </Link>)).toBe(true) |
| 33 | + }); |
| 34 | + it("should render a <Link /> with the label as 'Contact'", () => { |
| 35 | + const wrapper = shallow(<SidebarContainer />); |
| 36 | + |
| 37 | + expect(wrapper.contains(<Link className="sidebar-link" to="/contact" id="contact"> |
| 38 | + <ContactSupportIcon style={{ boxShadow: 'none', width: '40px', height: '40px' }} /> |
| 39 | +  Contact |
| 40 | + </Link>)).toBe(true) |
| 41 | + }); |
| 42 | + it("should render a <Link /> with the label as 'Settings'", () => { |
| 43 | + const wrapper = shallow(<SidebarContainer />); |
| 44 | + |
| 45 | + expect(wrapper.contains(<Link className="sidebar-link" to="/settings" id="settings"> |
| 46 | + <SettingsIcon style={{ boxShadow: 'none', width: '40px', height: '40px' }} /> |
| 47 | +  Settings |
| 48 | + </Link>)).toBe(true) |
| 49 | + }); |
| 50 | + |
| 51 | + |
7 | 52 | }); |
| 53 | + |
| 54 | + |
| 55 | + |
| 56 | + |
| 57 | + |
| 58 | + |
| 59 | + |
| 60 | + |
| 61 | + |
0 commit comments