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

@@ -91,6 +91,19 @@ describe('AuthGuardService BPM', () => {
expect(authService.getRedirect('BPM')).toEqual(['some-url', { q: '123' }]);
}));
it('should set redirect navigation commands with query params', async(() => {
spyOn(authService, 'setRedirect').and.callThrough();
spyOn(routerService, 'navigate').and.stub();
const router: RouterStateSnapshot = <RouterStateSnapshot> { url: '/' };
authGuard.canActivate(null, router);
expect(authService.setRedirect).toHaveBeenCalledWith({
provider: 'BPM', navigation: ['/']
});
expect(authService.getRedirect('BPM')).toEqual(['/']);
}));
it('should get redirect url from config if there is one configured', async(() => {
appConfigService.config.loginRoute = 'fakeLoginRoute';
spyOn(authService, 'setRedirect').and.callThrough();