mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-09-24 14:31:41 +00:00
workarounds for jasmine.ajax in unit tests
This commit is contained in:
committed by
Anton Ramanovich
parent
4d84f665ce
commit
880c670593
@@ -18,6 +18,7 @@
|
||||
import { DocumentListService } from './document-list.service';
|
||||
import { fakeAsync, TestBed } from '@angular/core/testing';
|
||||
import { ContentTestingModule } from '../../testing/content.testing.module';
|
||||
import { AdfHttpClient } from '@alfresco/adf-core/api';
|
||||
|
||||
declare let jasmine: any;
|
||||
|
||||
@@ -68,7 +69,11 @@ describe('DocumentListService', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [ContentTestingModule]
|
||||
imports: [ContentTestingModule],
|
||||
providers: [
|
||||
// TODO: remove this as soon as unit test not using jasmine.Ajax
|
||||
{ provide: AdfHttpClient, useValue: null }
|
||||
]
|
||||
});
|
||||
service = TestBed.inject(DocumentListService);
|
||||
jasmine.Ajax.install();
|
||||
|
@@ -31,7 +31,7 @@ export class AlfrescoApiService {
|
||||
protected appConfig = inject(AppConfigService);
|
||||
protected storageService = inject(StorageService);
|
||||
protected alfrescoApiFactory = inject<AlfrescoApiFactory>(ALFRESCO_API_FACTORY, { optional: true });
|
||||
protected adfHttpClient = inject(AdfHttpClient);
|
||||
protected adfHttpClient = inject(AdfHttpClient, { optional: true });
|
||||
|
||||
alfrescoApiInitialized: ReplaySubject<boolean> = new ReplaySubject(1);
|
||||
|
||||
|
Reference in New Issue
Block a user