import React from 'react';
import { Route } from 'react-router';
import { createBrowserHistory } from 'history';
import { expect } from 'chai';
import { shallow } from 'enzyme';
import Routes from '../src/Routes';
import Todo from '../src/containers/Todo';

describe('Routes', () => {
  it('renders correct containers for each route', () => {
    const wrapper = shallow(<Routes history={createBrowserHistory()}/>);

    const pathMap = wrapper.find(Route).reduce((routesMap, route) => {
      const routeProps = route.props();

      routesMap[routeProps.path] = routeProps.component;

      return routesMap;
    }, {});

    expect(pathMap['/']).to.equal(Todo);
  });
});

@@ -263,85 +263,23 @@
 %0D%0A%0D%0A
-describe('Routes', () =%3E %7B%0D%0A  it('renders correct containers for each route',
+const pathMap =
  () 
@@ -282,26 +282,24 @@
  () =%3E %7B%0D%0A  
- 
- 
 const wrappe
@@ -364,25 +364,14 @@
 %0D%0A  
-  const pathMap =
+return
  wra
@@ -423,18 +423,16 @@
  %7B%0D%0A    
-  
 const ro
@@ -464,18 +464,16 @@
 %0D%0A%0D%0A    
- 
- 
 routesMa
@@ -522,18 +522,16 @@
 %0D%0A%0D%0A    
-  
 return r
@@ -541,18 +541,16 @@
 esMap;%0D%0A
-  
   %7D, %7B%7D)
@@ -548,24 +548,116 @@
 %0A  %7D, %7B%7D);%0D%0A
+%7D;%0D%0A%0D%0Adescribe('Routes', () =%3E %7B%0D%0A  it('should render Todo container for %22/%22 route', () =%3E %7B
 %0D%0A    expect
@@ -664,16 +664,18 @@
 (pathMap
+()
 %5B'/'%5D).t

Improve Routes unit tests