Skip to content

Commit 47d0e75

Browse files
committed
changes made to Diffroute test jsx
1 parent 966f8b7 commit 47d0e75

File tree

1 file changed

+33
-2
lines changed

1 file changed

+33
-2
lines changed

src/app/__tests__/DiffRoute.test.jsx

Lines changed: 33 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,44 @@ import Adapter from 'enzyme-adapter-react-16';
44
import {
55
MemoryRouter as Router, Route, NavLink, Switch,
66
} from 'react-router-dom';
7+
// import { StaticRouter } from 'react-router';
78

89
import DiffRoute from '../components/DiffRoute.jsx';
910

11+
const props = {
12+
snapshot: [{}],
13+
};
14+
1015

1116
configure({ adapter: new Adapter() });
17+
let wrapper;
18+
19+
xdescribe('DiffRoute props', () => {
20+
it('should have a property called snapshot', () => {
21+
22+
});
23+
it('props snapshot value should be an array', () => {
24+
25+
});
26+
});
27+
28+
describe('DiffRoute component', () => {
29+
beforeEach(() => {
30+
wrapper = shallow(<DiffRoute {...props} />);
31+
});
32+
it('should contain a router component', () => {
33+
console.log('wrapper find route --> ', wrapper.find(Router).type());
34+
expect(wrapper.find(Router).type()).toEqual(Router);
35+
});
36+
it('div tag in Router should have a classname "navbar', () => {
37+
expect(wrapper.find('.navbar').type()).toBe('div');
38+
});
39+
it('router should have a switch component', () => {
40+
expect(wrapper.find(Switch).type()).toEqual(Switch);
41+
});
42+
});
43+
1244

13-
// check if our component has a component tag router
1445
// check if router component has a dive with a navlik component
15-
// check if component has a switch tag
46+
//check if navlinks go to appropriate routes
1647
// check if routes in switch have appropriate props

0 commit comments

Comments
 (0)