workarounds for jasmine.ajax in unit tests

This commit is contained in:
Denys Vuika
2024-09-13 14:30:55 -04:00
committed by Anton Ramanovich
parent 4d84f665ce
commit 880c670593
14 changed files with 81 additions and 24 deletions

View File

@@ -16,7 +16,7 @@
*/
import { HttpClient } from '@angular/common/http';
import { inject, Injectable } from '@angular/core';
import { Injectable } from '@angular/core';
import { ObjectUtils } from '../common/utils/object-utils';
import { Observable, ReplaySubject } from 'rxjs';
import { map, distinctUntilChanged, take } from 'rxjs/operators';
@@ -77,17 +77,14 @@ export class AppConfigService {
};
status: Status = Status.INIT;
protected onLoadSubject: ReplaySubject<any>;
onLoad: Observable<any>;
protected readonly onLoadSubject = new ReplaySubject<any>();
onLoad = this.onLoadSubject.asObservable();
get isLoaded() {
return this.status === Status.LOADED;
}
constructor() {
this.onLoadSubject = new ReplaySubject();
this.onLoad = this.onLoadSubject.asObservable();
this.extensionService.setup$.subscribe((config) => {
this.onExtensionsLoaded(config);
});

View File

@@ -15,15 +15,13 @@
* limitations under the License.
*/
import { Injectable } from '@angular/core';
import { inject, Injectable } from '@angular/core';
import { StorageService } from '../common/services/storage.service';
import { AppConfigService, AppConfigValues } from './app-config.service';
@Injectable()
export class DebugAppConfigService extends AppConfigService {
constructor(private storage: StorageService) {
super();
}
private storage = inject(StorageService);
get<T>(key: string, defaultValue?: T): T {
if (key === AppConfigValues.OAUTHCONFIG) {