@@ -4,13 +4,44 @@ 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 { StaticRouter } from 'react-router';
7
8
8
9
import DiffRoute from '../components/DiffRoute.jsx' ;
9
10
11
+ const props = {
12
+ snapshot : [ { } ] ,
13
+ } ;
14
+
10
15
11
16
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
+
12
44
13
- // check if our component has a component tag router
14
45
// 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
16
47
// check if routes in switch have appropriate props
0 commit comments