From 30efb73bb69c4328c284736ce553bf2061b21b1b Mon Sep 17 00:00:00 2001 From: Guido Quezada Date: Tue, 8 Dec 2020 19:09:47 -0500 Subject: [PATCH] TT-15 fix: setCookies for sing up or login test --- src/app/modules/login/login.component.spec.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/app/modules/login/login.component.spec.ts b/src/app/modules/login/login.component.spec.ts index 725dae4ce..78c7ac0f2 100644 --- a/src/app/modules/login/login.component.spec.ts +++ b/src/app/modules/login/login.component.spec.ts @@ -17,6 +17,8 @@ describe('LoginComponent', () => { }, signIn() { return of(); + }, + setCookies() { } }; @@ -49,11 +51,13 @@ describe('LoginComponent', () => { expect(component).toBeTruthy(); }); - it('should sign up or login with google if is not logged-in into the app', inject([Router], (router: Router) => { + fit('should sign up or login with google if is not logged-in into the app', inject([Router], (router: Router) => { spyOn(azureAdB2CService, 'isLogin').and.returnValue(false); - spyOn(azureAdB2CService, 'signIn').and.returnValue(of()); + spyOn(azureAdB2CService, 'setCookies').and.returnValue(); + spyOn(azureAdB2CService, 'signIn').and.returnValue(of(() => {})); component.login(); expect(azureAdB2CService.signIn).toHaveBeenCalled(); + expect(azureAdB2CService.setCookies).toHaveBeenCalled(); })); it('should not sign-up or login with google if is already logged-in into the app', inject([Router], (router: Router) => {