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

@@ -235,6 +235,28 @@ describe('AuthGuardService ECM', () => {
});
});
});
describe('with no route state', () => {
beforeEach(async(() => {
this.test = new TestConfig({
isLoggedIn: false
});
const { guard, auth, router } = this.test;
guard.canActivate(null, { url: '/' }).then((activate) => {
this.auth = auth;
});
this.navigateSpy = spyOn(router, 'navigate');
}));
it('should set redirect navigation commands with query params', () => {
expect(this.auth.setRedirect).toHaveBeenCalledWith({
provider: 'ECM', navigation: ['/']
});
});
});
});
describe('canActivateChild', () => {