Skip to content

Commit 1c4633e

Browse files
committed
Merge pull request #1068 from iam4x/patch-1
add `routeDepth` into `stubRouterContext` method
2 parents ba8195f + 505e828 commit 1c4633e

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

docs/guides/testing.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,16 +72,20 @@ var stubRouterContext = (Component, props, stubs) => {
7272
getCurrentParams () {},
7373
getCurrentQuery () {},
7474
isActive () {},
75+
getRouteAtDepth() {},
76+
setRouteComponentAtDepth() {}
7577
}, stubs)
7678

7779
return React.createClass({
7880
childContextTypes: {
79-
router: React.PropTypes.func
81+
router: React.PropTypes.func,
82+
routeDepth: React.PropTypes.number
8083
},
8184

8285
getChildContext () {
8386
return {
84-
router: RouterStub
87+
router: RouterStub,
88+
routeDepth: 0
8589
};
8690
},
8791

0 commit comments

Comments
 (0)