Skip to content

Commit 9fd73e0

Browse files
author
Guido Quezada
committed
TT-15 fix: setCookies for sing up or login test
1 parent 79ef1bf commit 9fd73e0

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/app/modules/login/login.component.spec.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ describe('LoginComponent', () => {
1717
},
1818
signIn() {
1919
return of();
20+
},
21+
setCookies() {
2022
}
2123
};
2224

@@ -56,6 +58,15 @@ describe('LoginComponent', () => {
5658
expect(azureAdB2CService.signIn).toHaveBeenCalled();
5759
}));
5860

61+
it('test line 20-2', inject([Router], (router: Router) => {
62+
spyOn(azureAdB2CService, 'isLogin').and.returnValue(false);
63+
spyOn(azureAdB2CService, 'setCookies').and.returnValue();
64+
spyOn(azureAdB2CService, 'signIn').and.returnValue(of(() => { }));
65+
component.login();
66+
expect(azureAdB2CService.signIn).toHaveBeenCalled();
67+
expect(azureAdB2CService.setCookies).toHaveBeenCalled();
68+
}));
69+
5970
it('should not sign-up or login with google if is already logged-in into the app', inject([Router], (router: Router) => {
6071
spyOn(azureAdB2CService, 'isLogin').and.returnValue(true);
6172
spyOn(router, 'navigate').and.stub();

0 commit comments

Comments
 (0)