mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-09-17 14:21:29 +00:00
Fixed related unit test
This commit is contained in:
@@ -21,6 +21,7 @@ import { AuthGuardSsoRoleService } from './auth-guard-sso-role.service';
|
||||
import { JwtHelperService, JWT_STORAGE_SERVICE } from '../services/jwt-helper.service';
|
||||
import { MatDialog, MatDialogModule } from '@angular/material/dialog';
|
||||
import { NoopTranslateModule } from '../../testing/noop-translate.module';
|
||||
import { StorageService } from '../../common';
|
||||
|
||||
describe('Auth Guard SSO role service', () => {
|
||||
let jwtHelperService: JwtHelperService;
|
||||
@@ -30,7 +31,7 @@ describe('Auth Guard SSO role service', () => {
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [NoopTranslateModule, MatDialogModule],
|
||||
providers: [{ provide: JWT_STORAGE_SERVICE, useValue: { getItem: () => {}, setItem: () => {}, removeItem: () => {} } }]
|
||||
providers: [{ provide: JWT_STORAGE_SERVICE, useClass: StorageService }]
|
||||
});
|
||||
localStorage.clear();
|
||||
jwtHelperService = TestBed.inject(JwtHelperService);
|
||||
|
@@ -20,6 +20,7 @@ import { UserAccessService } from './user-access.service';
|
||||
import { JwtHelperService, JWT_STORAGE_SERVICE } from './jwt-helper.service';
|
||||
import { AppConfigService } from '../../app-config';
|
||||
import { HttpClientTestingModule } from '@angular/common/http/testing';
|
||||
import { StorageService } from '../../common';
|
||||
|
||||
describe('UserAccessService', () => {
|
||||
let userAccessService: UserAccessService;
|
||||
@@ -29,7 +30,7 @@ describe('UserAccessService', () => {
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [HttpClientTestingModule],
|
||||
providers: [UserAccessService, { provide: JWT_STORAGE_SERVICE, useValue: {} }]
|
||||
providers: [UserAccessService, { provide: JWT_STORAGE_SERVICE, useValue: StorageService }]
|
||||
});
|
||||
userAccessService = TestBed.inject(UserAccessService);
|
||||
jwtHelperService = TestBed.inject(JwtHelperService);
|
||||
|
Reference in New Issue
Block a user