-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e4f5db3
commit e74b4b3
Showing
2 changed files
with
43 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import createRouter from 'router5'; | ||
import React, { Component, PropTypes } from 'react'; | ||
import { RouterProvider } from '../modules'; | ||
import { renderIntoDocument } from 'react-addons-test-utils'; | ||
import browserPlugin from 'router5/plugins/browser'; | ||
|
||
export class Child extends Component { | ||
render() { | ||
return <div />; | ||
} | ||
} | ||
|
||
Child.contextTypes = { | ||
router: PropTypes.object.isRequired | ||
}; | ||
|
||
export const FnChild = (props) => <div />; | ||
|
||
export const createTestRouter = () => createRouter().usePlugin(browserPlugin()); | ||
|
||
export const renderWithRouter = router => BaseComponent => renderIntoDocument( | ||
<RouterProvider router={ router }> | ||
<BaseComponent /> | ||
</RouterProvider> | ||
); |