Fixed unit test after rebase

This commit is contained in:
VitoAlbano
2024-06-21 10:19:45 +01:00
parent 0107b3b6fe
commit b54cc68854
19 changed files with 35 additions and 34 deletions

View File

@@ -25,7 +25,7 @@ import { TranslateModule } from '@ngx-translate/core';
import { BasicAlfrescoAuthService } from '../basic-auth/basic-alfresco-auth.service';
import { HttpClientTestingModule } from '@angular/common/http/testing';
import { RedirectAuthService } from '../oidc/redirect-auth.service';
import { EMPTY } from 'rxjs';
import { EMPTY, of } from 'rxjs';
import { OidcAuthenticationService } from '../oidc/oidc-authentication.service';
describe('AuthGuardService BPM', () => {
@@ -41,7 +41,7 @@ describe('AuthGuardService BPM', () => {
TestBed.configureTestingModule({
imports: [TranslateModule.forRoot(), HttpClientTestingModule, MatDialogModule],
providers: [
{ provide: RedirectAuthService, useValue: { onLogin: EMPTY } },
{ provide: RedirectAuthService, useValue: { onLogin: EMPTY, onTokenReceived: of() } },
{
provide: OidcAuthenticationService,
useValue: {

View File

@@ -26,7 +26,7 @@ import { BasicAlfrescoAuthService } from '../basic-auth/basic-alfresco-auth.serv
import { HttpClientTestingModule } from '@angular/common/http/testing';
import { RouterTestingModule } from '@angular/router/testing';
import { RedirectAuthService } from '../oidc/redirect-auth.service';
import { EMPTY } from 'rxjs';
import { EMPTY, of } from 'rxjs';
import { OidcAuthenticationService } from '../oidc/oidc-authentication.service';
describe('AuthGuardService ECM', () => {
@@ -52,7 +52,7 @@ describe('AuthGuardService ECM', () => {
isLoggedIn: () => false
}
},
{ provide: RedirectAuthService, useValue: { onLogin: EMPTY } }
{ provide: RedirectAuthService, useValue: { onLogin: EMPTY, onTokenReceived: of() } }
]
});
localStorage.clear();

View File

@@ -25,7 +25,7 @@ import { StorageService } from '../../common/services/storage.service';
import { OidcAuthenticationService } from '../oidc/oidc-authentication.service';
import { BasicAlfrescoAuthService } from '../basic-auth/basic-alfresco-auth.service';
import { RedirectAuthService } from '../oidc/redirect-auth.service';
import { EMPTY } from 'rxjs';
import { EMPTY, of } from 'rxjs';
import { HttpClientTestingModule } from '@angular/common/http/testing';
import { MatDialogModule } from '@angular/material/dialog';
import { RouterTestingModule } from '@angular/router/testing';
@@ -46,7 +46,7 @@ describe('AuthGuardService', () => {
providers: [
AppConfigService,
StorageService,
{ provide: RedirectAuthService, useValue: { onLogin: EMPTY } },
{ provide: RedirectAuthService, useValue: { onLogin: EMPTY, onTokenReceived: of() } },
{
provide: OidcAuthenticationService,
useValue: {

View File

@@ -542,7 +542,7 @@ describe('AuthenticationService', () => {
const onTokenReceivedSpy = jasmine.createSpy();
authenticationService.onTokenReceived.subscribe(onTokenReceivedSpy);
onTokenReceived$.next();
onTokenReceived$.next({ type: 'token_received' });
expect(onTokenReceivedSpy).toHaveBeenCalled();
});