mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-05-26 17:24:56 +00:00
Fixed related unit test
This commit is contained in:
parent
98359e1073
commit
c0ce6f70b3
@ -27,6 +27,8 @@ import { EMPTY, of } from 'rxjs';
|
||||
import { OidcAuthenticationService } from '../oidc/oidc-authentication.service';
|
||||
import { AuthGuardService } from './auth-guard.service';
|
||||
import { NoopTranslateModule } from '../../testing/noop-translate.module';
|
||||
import { JWT_STORAGE_SERVICE } from '../public-api';
|
||||
import { StorageService } from '../../common';
|
||||
|
||||
describe('AuthGuardService BPM', () => {
|
||||
let authGuard: Promise<boolean>;
|
||||
@ -45,6 +47,7 @@ describe('AuthGuardService BPM', () => {
|
||||
providers: [
|
||||
AuthGuardService,
|
||||
{ provide: RedirectAuthService, useValue: { onLogin: EMPTY, onTokenReceived: of() } },
|
||||
{ provide: JWT_STORAGE_SERVICE, useClass: StorageService },
|
||||
{
|
||||
provide: OidcAuthenticationService,
|
||||
useValue: {
|
||||
|
@ -27,6 +27,8 @@ import { RedirectAuthService } from '../oidc/redirect-auth.service';
|
||||
import { EMPTY, of } from 'rxjs';
|
||||
import { OidcAuthenticationService } from '../oidc/oidc-authentication.service';
|
||||
import { NoopTranslateModule } from '../../testing/noop-translate.module';
|
||||
import { JWT_STORAGE_SERVICE } from '../public-api';
|
||||
import { StorageService } from '../../common';
|
||||
|
||||
describe('AuthGuardService ECM', () => {
|
||||
let authGuard: Promise<boolean>;
|
||||
@ -54,7 +56,8 @@ describe('AuthGuardService ECM', () => {
|
||||
shouldPerformSsoLogin$: of(true)
|
||||
}
|
||||
},
|
||||
{ provide: RedirectAuthService, useValue: { onLogin: EMPTY, onTokenReceived: of() } }
|
||||
{ provide: RedirectAuthService, useValue: { onLogin: EMPTY, onTokenReceived: of() } },
|
||||
{ provide: JWT_STORAGE_SERVICE, useClass: StorageService }
|
||||
]
|
||||
});
|
||||
localStorage.clear();
|
||||
|
@ -28,6 +28,7 @@ import { EMPTY, of } from 'rxjs';
|
||||
import { MatDialogModule } from '@angular/material/dialog';
|
||||
import { RouterTestingModule } from '@angular/router/testing';
|
||||
import { NoopTranslateModule } from '../../testing/noop-translate.module';
|
||||
import { JWT_STORAGE_SERVICE } from '../public-api';
|
||||
|
||||
describe('AuthGuardService', () => {
|
||||
let state: RouterStateSnapshot;
|
||||
@ -45,7 +46,7 @@ describe('AuthGuardService', () => {
|
||||
imports: [NoopTranslateModule, MatDialogModule, RouterTestingModule],
|
||||
providers: [
|
||||
AppConfigService,
|
||||
StorageService,
|
||||
{ provide: JWT_STORAGE_SERVICE, useClass: StorageService },
|
||||
{ provide: RedirectAuthService, useValue: { onLogin: EMPTY, onTokenReceived: of() } },
|
||||
{
|
||||
provide: OidcAuthenticationService,
|
||||
|
@ -65,7 +65,6 @@ describe('OidcAuthenticationService', () => {
|
||||
{ provide: OAuthService, useClass: MockOAuthService },
|
||||
{ provide: OAuthStorage, useValue: {} },
|
||||
{ provide: AUTH_MODULE_CONFIG, useValue: {} },
|
||||
{ provide: AuthService, useValue: {} }
|
||||
]
|
||||
});
|
||||
service = TestBed.inject(OidcAuthenticationService);
|
||||
|
@ -42,7 +42,7 @@ describe('JwtHelperService', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
providers: [JwtHelperService, { provide: StorageService, useValue: mockStorage }]
|
||||
providers: [JwtHelperService, { provide: JWT_STORAGE_SERVICE, useValue: mockStorage }]
|
||||
});
|
||||
jwtHelperService = TestBed.inject(JwtHelperService);
|
||||
});
|
||||
|
@ -30,7 +30,7 @@ describe('UserAccessService', () => {
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [HttpClientTestingModule],
|
||||
providers: [UserAccessService, { provide: JWT_STORAGE_SERVICE, useValue: StorageService }]
|
||||
providers: [{ provide: JWT_STORAGE_SERVICE, useClass: StorageService }, UserAccessService]
|
||||
});
|
||||
userAccessService = TestBed.inject(UserAccessService);
|
||||
jwtHelperService = TestBed.inject(JwtHelperService);
|
||||
|
Loading…
x
Reference in New Issue
Block a user