@@ -4,7 +4,7 @@ import Adapter from 'enzyme-adapter-react-16';
44import {
55 MemoryRouter as Router , Route , NavLink , Switch ,
66} from 'react-router-dom' ;
7- // import { StaticRouter } from 'react-router ';
7+ import { createBrowserHistory , createMemoryHistory } from 'history ' ;
88
99import DiffRoute from '../components/DiffRoute.jsx' ;
1010
@@ -16,12 +16,12 @@ const props = {
1616configure ( { adapter : new Adapter ( ) } ) ;
1717let wrapper ;
1818
19- xdescribe ( 'DiffRoute props' , ( ) => {
19+ describe ( 'DiffRoute props' , ( ) => {
2020 it ( 'should have a property called snapshot' , ( ) => {
21-
21+ expect ( props ) . toHaveProperty ( 'snapshot' ) ;
2222 } ) ;
2323 it ( 'props snapshot value should be an array' , ( ) => {
24-
24+ expect ( Array . isArray ( props . snapshot ) ) . toBe ( true )
2525 } ) ;
2626} ) ;
2727
@@ -30,7 +30,7 @@ describe('DiffRoute component', () => {
3030 wrapper = shallow ( < DiffRoute { ...props } /> ) ;
3131 } ) ;
3232 it ( 'should contain a router component' , ( ) => {
33- console . log ( 'wrapper find route --> ' , wrapper . find ( Router ) . type ( ) ) ;
33+
3434 expect ( wrapper . find ( Router ) . type ( ) ) . toEqual ( Router ) ;
3535 } ) ;
3636 it ( 'div tag in Router should have a classname "navbar' , ( ) => {
@@ -43,5 +43,5 @@ describe('DiffRoute component', () => {
4343
4444
4545// check if router component has a dive with a navlik component
46- //check if navlinks go to appropriate routes
46+ // check if navlinks go to appropriate routes
4747// check if routes in switch have appropriate props
0 commit comments