Skip to content
This repository has been archived by the owner on Jan 1, 2024. It is now read-only.

Commit

Permalink
fix: fix routes import in app
Browse files Browse the repository at this point in the history
fix: fix `routes` import in app
  • Loading branch information
Metnew committed Nov 4, 2017
1 parent 8241518 commit a862358
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions src/common/components/addons/RouteAuth/index.test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from 'react'
import {Route, Redirect} from 'react-router-dom'
import RouteAuth from 'components/addons/RouteAuth'
import {shallow} from 'enzyme'
import {routes as routing} from 'routing'
import {getRouterRoutes} from 'routing'

const accessToInboxOnly = path => {
return path === '/inbox'
Expand All @@ -11,10 +11,10 @@ const accessExceptInbox = path => {
return path !== '/inbox'
}

const sampleRouteItem = routing.filter(a => a.component && a.tag)[0]
const sampleRouteItem = getRouterRoutes()[0]

describe('RouteAuth component', () => {
it('creates <Redirect /> if user doesn\'t have access', () => {
it("creates <Redirect /> if user doesn't have access", () => {
const gotRedirect = {
...sampleRouteItem,
canAccess: accessExceptInbox,
Expand Down
6 changes: 3 additions & 3 deletions src/common/components/parts/Sidebar/index.test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@ import React from 'react'
import Sidebar from 'components/parts/Sidebar'
import {shallow} from 'enzyme'
import toJson from 'enzyme-to-json'
import {routes as routing} from 'routing'
import {getSidebarRoutes} from 'routing'

const props = {
isMobile: true,
logout: () => ({}),
routing,
routing: getSidebarRoutes(),
open: true
}

describe('Sidebar component', () => {
it('same snapshot if Sidebar is open and it is on mobile screen', () => {
it('same snapshot for Sidebar', () => {
const component = shallow(<Sidebar {...props} />)
expect(toJson(component)).toMatchSnapshot()
})
Expand Down

0 comments on commit a862358

Please sign in to comment.