fix(router): process empty path segment when preceding a named outlet (#26243)

PR Close #10726

PR Close #26243
This commit is contained in:
miginmrs
2018-10-05 19:22:06 +01:00
committed by Igor Minar
parent ccc77ca441
commit 20cef5078d
2 changed files with 22 additions and 0 deletions

View File

@ -263,6 +263,20 @@ describe('recognize', () => {
});
});
it('should work with children outlets', () => {
checkRecognize(
[{
path: '',
component: ComponentA,
children: [{path: 'b', outlet: 'b', component: ComponentB}]
}],
'(b:b)', (s: RouterStateSnapshot) => {
checkActivatedRoute((s as any).firstChild(s.root) !, '', {}, ComponentA);
checkActivatedRoute(
(s as any).firstChild((s as any).firstChild(s.root)) !, 'b', {}, ComponentB, 'b');
});
});
it('should match when terminal', () => {
checkRecognize(
[{path: '', pathMatch: 'full', component: ComponentA}], '',