cleanup(router): add a test verifying than NavigationEnd is not emitted after NavigationCancel
This commit is contained in:
parent
5ae6915600
commit
0f21a5823b
|
@ -888,6 +888,9 @@ describe('Integration', () => {
|
|||
it('works', fakeAsync(inject([Router, Location], (router: Router, location: Location) => {
|
||||
const fixture = createRoot(router, RootCmp);
|
||||
|
||||
const recordedEvents: any[] = [];
|
||||
router.events.forEach(e => recordedEvents.push(e));
|
||||
|
||||
router.resetConfig(
|
||||
[{path: 'team/:id', component: TeamCmp, canActivate: ['alwaysFalse']}]);
|
||||
|
||||
|
@ -895,6 +898,10 @@ describe('Integration', () => {
|
|||
advance(fixture);
|
||||
|
||||
expect(location.path()).toEqual('/');
|
||||
expectEvents(recordedEvents, [
|
||||
[NavigationStart, '/team/22'], [RoutesRecognized, '/team/22'],
|
||||
[NavigationCancel, '/team/22']
|
||||
]);
|
||||
})));
|
||||
});
|
||||
|
||||
|
|
Loading…
Reference in New Issue