diff --git a/src/routers/__tests__/StackRouter-test.js b/src/routers/__tests__/StackRouter-test.js index 9f143ca..4cba0bc 100644 --- a/src/routers/__tests__/StackRouter-test.js +++ b/src/routers/__tests__/StackRouter-test.js @@ -426,12 +426,47 @@ describe('StackRouter', () => { expect(state3 && state3.index).toEqual(0); }); + test('Handle navigation to nested navigator', () => { + const state = TestStackRouter.getStateForAction({ + type: NavigationActions.INIT, + }); + const action = TestStackRouter.getActionForPathAndParams('fo/22/b/hello'); + /* $FlowFixMe */ + const state2 = TestStackRouter.getStateForAction(action); + expect(state2).toEqual({ + index: 0, + isTransitioning: false, + key: 'StackRouterRoot', + routes: [ + { + index: 0, + key: 'id-4', + isTransitioning: false, + routeName: 'foo', + params: { + fooThing: '22', + }, + routes: [ + { + routeName: 'bar', + key: 'id-3', + params: { + barThing: 'hello', + }, + }, + ], + }, + ], + }); + }); + test('popToTop bubbles up', () => { const ChildNavigator = () =>
; ChildNavigator.router = StackRouter({ Baz: { screen: () => }, Qux: { screen: () => }, }); + const router = StackRouter({ Foo: { screen: () => }, Bar: { screen: ChildNavigator },