feat(router): empty-path routes should inherit matrix params

This commit is contained in:
vsavkin
2016-07-08 14:23:23 -07:00
parent 34b3c534e7
commit a77db44129
2 changed files with 32 additions and 11 deletions

View File

@ -262,6 +262,23 @@ describe('recognize', () => {
expect(c2._lastPathIndex).toBe(-1);
});
});
it('should inherit params', () => {
checkRecognize(
[{
path: 'a',
component: ComponentA,
children: [
{path: '', component: ComponentB, children: [{path: '', component: ComponentC}]}
]
}],
'/a;p=1', (s: RouterStateSnapshot) => {
checkActivatedRoute(s.firstChild(s.root), 'a', {p: '1'}, ComponentA);
checkActivatedRoute(s.firstChild(s.firstChild(s.root)), '', {p: '1'}, ComponentB);
checkActivatedRoute(
s.firstChild(s.firstChild(s.firstChild(s.root))), '', {p: '1'}, ComponentC);
});
});
});
describe('aux split is in the middle', () => {