cleanup(router): add a test verifying than NavigationEnd is not emitted after NavigationCancel

This commit is contained in:
vsavkin
2016-10-19 14:32:03 -07:00
committed by Igor Minar
parent 20b4617289
commit 2598b59de7

View File

@ -887,6 +887,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']}]);
@ -894,6 +897,10 @@ describe('Integration', () => {
advance(fixture);
expect(location.path()).toEqual('/');
expectEvents(recordedEvents, [
[NavigationStart, '/team/22'], [RoutesRecognized, '/team/22'],
[NavigationCancel, '/team/22']
]);
})));
});