mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-09-17 14:21:29 +00:00
workarounds for jasmine.ajax in unit tests
This commit is contained in:
committed by
Anton Ramanovich
parent
4d84f665ce
commit
880c670593
@@ -71,12 +71,23 @@ export class AdfHttpClient implements ee.Emitter, JsApiHttpClient {
|
||||
ee(this);
|
||||
}
|
||||
|
||||
/** @deprecated not used anywhere */
|
||||
/**
|
||||
* Update the default security options
|
||||
*
|
||||
* @param options security options
|
||||
* @deprecated not used anywhere
|
||||
*/
|
||||
setDefaultSecurityOption(options: any) {
|
||||
this.defaultSecurityOptions = this.merge(this.defaultSecurityOptions, options);
|
||||
}
|
||||
|
||||
/** @deprecated not used anywhere */
|
||||
/**
|
||||
* Merge objects
|
||||
*
|
||||
* @param objects objects to merge
|
||||
* @deprecated not used anywhere
|
||||
* @returns merged object
|
||||
*/
|
||||
merge(...objects): any {
|
||||
const result = {};
|
||||
|
||||
@@ -228,6 +239,7 @@ export class AdfHttpClient implements ee.Emitter, JsApiHttpClient {
|
||||
)
|
||||
.toPromise();
|
||||
|
||||
/* eslint-disable @typescript-eslint/space-before-function-paren */
|
||||
(promise as any).abort = function () {
|
||||
eventEmitter.emit('abort');
|
||||
abort$.next();
|
||||
|
@@ -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);
|
||||
});
|
||||
|
@@ -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) {
|
||||
|
Reference in New Issue
Block a user