Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix: TTA-180 increasing test coveragew
  • Loading branch information
Rodrigo Lins committed Oct 19, 2022
commit 17e59325e34cd2b3babd112d6d9980a57f44608b
10 changes: 10 additions & 0 deletions src/app/modules/login/login.component.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,16 @@ describe('LoginComponent', () => {
expect(component).toBeTruthy();
});

it('should set local storage when the component is initialized and is not legacy production', inject([Router], (router: Router) => {
component.isProduction = false;
spyOn(loginService, 'getUser').and.returnValue(of(userTest));
spyOn(loginService, 'setLocalStorage');

component.ngOnInit();

expect(loginService.setLocalStorage).toHaveBeenCalled();
}));

it('should sign up or login with google if is not logged-in into the app on Production', inject([Router], (router: Router) => {
spyOn(azureAdB2CService, 'isLogin').and.returnValue(false);
spyOn(azureAdB2CService, 'setCookies').and.returnValue();
Expand Down
5 changes: 5 additions & 0 deletions src/app/modules/login/services/login.service.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,11 @@ describe('LoginService', () => {
expect(cookieService.deleteAll).toHaveBeenCalled();
});

it('should return an http observable when call invalidateSessionCooke', () => {
const result = service.invalidateSessionCookie()
expect(result).toBeDefined();
})

it('should call cookieService when app is isLegacyProd', () => {
service.isLegacyProd = true;
service.localStorageKey = 'user2';
Expand Down