pass actual redirect when no state (#3285)

This commit is contained in:
Cilibiu Bogdan
2018-05-09 09:59:03 +03:00
committed by Denys Vuika
parent 4fbacf4860
commit f63614e964
6 changed files with 63 additions and 0 deletions

View File

@@ -101,4 +101,17 @@ describe('AuthGuardService', () => {
});
expect(router.navigate).toHaveBeenCalledWith(['/fakeLoginRoute']);
}));
it('should pass actual redirect when no state segments exists', async(() => {
state.url = '/';
spyOn(router, 'navigate');
spyOn(authService, 'setRedirect');
service.canActivate(null, state);
expect(authService.setRedirect).toHaveBeenCalledWith({
provider: 'ALL', navigation: ['/']
});
}));
});