1
1
import React from 'react' ;
2
- import { configure , shallow } from 'enzyme'
2
+ import { configure , shallow } from 'enzyme' ;
3
3
import Adapter from 'enzyme-adapter-react-16' ;
4
4
import {
5
5
MemoryRouter as Router , Route , NavLink , Switch ,
6
6
} from 'react-router-dom' ;
7
- import { createBrowserHistory , createMemoryHistory } from 'history' ;
8
7
9
8
import DiffRoute from '../components/DiffRoute.jsx' ;
10
9
@@ -21,16 +20,15 @@ describe('DiffRoute props', () => {
21
20
expect ( props ) . toHaveProperty ( 'snapshot' ) ;
22
21
} ) ;
23
22
it ( 'props snapshot value should be an array' , ( ) => {
24
- expect ( Array . isArray ( props . snapshot ) ) . toBe ( true )
23
+ expect ( Array . isArray ( props . snapshot ) ) . toBe ( true ) ;
25
24
} ) ;
26
25
} ) ;
27
26
28
27
describe ( 'DiffRoute component' , ( ) => {
29
28
beforeEach ( ( ) => {
30
- wrapper = shallow ( < DiffRoute { ... props } /> ) ;
29
+ wrapper = shallow ( < DiffRoute /> ) ;
31
30
} ) ;
32
31
it ( 'should contain a router component' , ( ) => {
33
-
34
32
expect ( wrapper . find ( Router ) . type ( ) ) . toEqual ( Router ) ;
35
33
} ) ;
36
34
it ( 'div tag in Router should have a classname "navbar' , ( ) => {
@@ -41,7 +39,7 @@ describe('DiffRoute component', () => {
41
39
} ) ;
42
40
} ) ;
43
41
44
-
45
- // check if router component has a dive with a navlik component
46
- // check if navlinks go to appropriate routes
42
+ // remaining tests:
43
+ // check if router component has a div with a navlik component
44
+ // check if navlinks go to appropriate routes, and text shows Tree and Raw
47
45
// check if routes in switch have appropriate props
0 commit comments