mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
Fixed unit test after rebase
This commit is contained in:
@@ -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: {
|
||||
|
@@ -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();
|
||||
|
@@ -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: {
|
||||
|
@@ -542,7 +542,7 @@ describe('AuthenticationService', () => {
|
||||
const onTokenReceivedSpy = jasmine.createSpy();
|
||||
authenticationService.onTokenReceived.subscribe(onTokenReceivedSpy);
|
||||
|
||||
onTokenReceived$.next();
|
||||
onTokenReceived$.next({ type: 'token_received' });
|
||||
|
||||
expect(onTokenReceivedSpy).toHaveBeenCalled();
|
||||
});
|
||||
|
Reference in New Issue
Block a user