fix(router): handle urls with only secondary top-level segments

This commit is contained in:
vsavkin
2016-07-21 14:50:38 -07:00
parent 31a7709ece
commit 44709e0dca
4 changed files with 55 additions and 8 deletions

View File

@ -494,6 +494,22 @@ describe('recognize', () => {
checkActivatedRoute(c[1], 'c', {}, ComponentC, 'aux');
});
});
it('should work when split is at the root level', () => {
checkRecognize(
[
{path: '', component: ComponentA}, {path: 'b', component: ComponentB},
{path: 'c', component: ComponentC, outlet: 'aux'}
],
'(aux:c)', (s: RouterStateSnapshot) => {
checkActivatedRoute(s.root, '', {}, RootComponent);
const children = s.children(s.root);
expect(children.length).toEqual(2);
checkActivatedRoute(children[0], '', {}, ComponentA);
checkActivatedRoute(children[1], 'c', {}, ComponentC, 'aux');
});
});
});
describe('split at the end (right child)', () => {