ACS-8761 Noop Auth Module for unit testing ergonomics (#10195)

This commit is contained in:
Denys Vuika
2024-09-18 08:05:26 -04:00
committed by GitHub
parent 075c6891fe
commit 4d4a1dd6b1
69 changed files with 630 additions and 836 deletions

View File

@@ -17,7 +17,7 @@
import { TestBed } from '@angular/core/testing';
import { StorageFeaturesService } from './storage-features.service';
import { CoreTestingModule, StorageService } from '../../../../src/public-api';
import { StorageService } from '../../../../src/public-api';
import { FlagSet, WritableFeaturesServiceConfigToken } from '../interfaces/features.interface';
import { skip, take } from 'rxjs/operators';
@@ -41,7 +41,6 @@ describe('StorageFeaturesService', () => {
beforeEach(() => {
TestBed.configureTestingModule({
imports: [CoreTestingModule],
providers: [
{ provide: StorageService, useValue: mockStorage },
{
@@ -49,8 +48,7 @@ describe('StorageFeaturesService', () => {
useValue: {
storageKey: 'storage-key-test'
}
},
StorageFeaturesService
}
]
});
@@ -170,11 +168,6 @@ describe('StorageFeaturesService', () => {
describe('if flags are not present in LocalStorage and no configuration is provided', () => {
beforeEach(() => {
TestBed.configureTestingModule({
imports: [CoreTestingModule],
providers: [StorageFeaturesService]
});
storageFeaturesService = TestBed.inject(StorageFeaturesService);
});

View File

@@ -30,7 +30,7 @@ import {
import { FlagSetParser } from './flagset.parser';
import { StorageService } from '@alfresco/adf-core';
@Injectable()
@Injectable({ providedIn: 'root' })
export class StorageFeaturesService implements IFeaturesService, IWritableFeaturesService {
private currentFlagState: WritableFlagChangeset = {};
private flags = new BehaviorSubject<WritableFlagChangeset>({});