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

Commit

Permalink
fix non-working initial enhanced routes, add regression test
Browse files Browse the repository at this point in the history
  • Loading branch information
cellog committed May 4, 2017
1 parent 6160757 commit 05ebd2c
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ion-router",
"version": "0.11.0",
"version": "0.11.1",
"description": "elegant powerful routing based on the simplicity of storing url as state",
"main": "lib/index.js",
"homepage": "https://cellog.github.io/ion-router",
Expand Down
2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,6 @@ export default function makeRouter(connect, store, routeDefinitions,
connectToggle(connect, storeKey)
store.routerOptions.isServer = isServer // eslint-disable-line
if (routeDefinitions) {
store.dispatch(synchronousMakeRoutes(routeDefinitions, store.routerOptions.enhancedRoutes))
store.dispatch(synchronousMakeRoutes(routeDefinitions, store.routerOptions))
}
}
19 changes: 19 additions & 0 deletions test/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,25 @@ describe('ion-router', () => {
]
index.default(() => () => null, store, routes)
expect(log).eqls([actions.batchRoutes(routes)])
expect(store.routerOptions).eqls({
enhancedRoutes: {
hi: {
...enhancers.enhanceRoute({
name: 'hi',
path: '/hi',
parent: undefined,
})
},
there: {
...enhancers.enhanceRoute({
name: 'there',
path: '/there',
parent: undefined,
})
}
},
isServer: false
})
})
})
})

0 comments on commit 05ebd2c

Please sign in to comment.