fix(router): canceled navigations should return a promise that is resolved with false

This commit is contained in:
vsavkin
2016-06-25 13:31:48 -07:00
parent 3f44377f2f
commit 855f3afb28
2 changed files with 11 additions and 6 deletions

View File

@ -731,13 +731,17 @@ describe('Integration', () => {
advance(fixture);
expect(location.path()).toEqual('/team/22');
router.navigateByUrl('/team/33');
let successStatus;
router.navigateByUrl('/team/33').then(res => successStatus = res);
advance(fixture);
expect(location.path()).toEqual('/team/33');
expect(successStatus).toEqual(true);
router.navigateByUrl('/team/44');
let canceledStatus;
router.navigateByUrl('/team/44').then(res => canceledStatus = res);
advance(fixture);
expect(location.path()).toEqual('/team/33');
expect(canceledStatus).toEqual(false);
})));
it('works (componentless route)',