mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-06-02 17:35:08 +00:00
[affected:*][ci:force] - Fixed problem after rebase
This commit is contained in:
parent
a86d6bbccb
commit
cd4e5f78f1
@ -17,12 +17,13 @@
|
||||
|
||||
import { EventEmitter } from '@angular/core';
|
||||
import { TestBed } from '@angular/core/testing';
|
||||
import { AlfrescoApiService, AlfrescoApiServiceMock, AppConfigModule, AppConfigService } from '@alfresco/adf-core';
|
||||
import { AlfrescoApiService, AlfrescoApiServiceMock, AppConfigModule, AppConfigService, AppConfigServiceMock } from '@alfresco/adf-core';
|
||||
import { UploadService } from './upload.service';
|
||||
import { RepositoryInfo } from '@alfresco/js-api';
|
||||
import { BehaviorSubject } from 'rxjs';
|
||||
import { DiscoveryApiService } from '../../common/services/discovery-api.service';
|
||||
import { FileModel, FileUploadStatus } from '../../common/models/file.model';
|
||||
import { HttpClientTestingModule } from '@angular/common/http/testing';
|
||||
|
||||
declare let jasmine: any;
|
||||
|
||||
@ -35,10 +36,11 @@ describe('UploadService', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [AppConfigModule],
|
||||
imports: [AppConfigModule, HttpClientTestingModule],
|
||||
providers: [
|
||||
UploadService,
|
||||
{ provide: AlfrescoApiService, useClass: AlfrescoApiServiceMock },
|
||||
{ provide: AppConfigService, useClass: AppConfigServiceMock },
|
||||
{
|
||||
provide: DiscoveryApiService,
|
||||
useValue: {
|
||||
|
@ -37,7 +37,7 @@ describe('FolderDialogComponent', () => {
|
||||
let createFolderSpy: jasmine.Spy;
|
||||
|
||||
const updateNode$ = new BehaviorSubject(null);
|
||||
const createFolderNode$ = new BehaviorSubject(null);
|
||||
let createFolderNode$ = null;
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
@ -48,6 +48,7 @@ describe('FolderDialogComponent', () => {
|
||||
fixture = TestBed.createComponent(FolderDialogComponent);
|
||||
component = fixture.componentInstance;
|
||||
nodesApi = TestBed.inject(NodesApiService);
|
||||
createFolderNode$ = new BehaviorSubject(null);
|
||||
|
||||
createFolderSpy = spyOn(nodesApi, 'createFolder').and.returnValue(createFolderNode$);
|
||||
updateNodeSpy = spyOn(nodesApi, 'updateNode').and.returnValue(updateNode$);
|
||||
@ -273,8 +274,13 @@ describe('FolderDialogComponent', () => {
|
||||
});
|
||||
|
||||
describe('Error events', () => {
|
||||
let errorSubscriber = null;
|
||||
|
||||
afterEach(() => {
|
||||
createFolderNode$.next(null);
|
||||
if (errorSubscriber) {
|
||||
errorSubscriber.complete();
|
||||
}
|
||||
});
|
||||
|
||||
it('should raise error for 409', (done) => {
|
||||
@ -283,7 +289,7 @@ describe('FolderDialogComponent', () => {
|
||||
};
|
||||
createFolderNode$.error(error);
|
||||
|
||||
component.error.subscribe((message) => {
|
||||
errorSubscriber = component.error.subscribe((message) => {
|
||||
expect(message).toBe('CORE.MESSAGES.ERRORS.EXISTENT_FOLDER');
|
||||
done();
|
||||
});
|
||||
@ -300,7 +306,7 @@ describe('FolderDialogComponent', () => {
|
||||
};
|
||||
createFolderNode$.error(error);
|
||||
|
||||
component.error.subscribe((message) => {
|
||||
errorSubscriber = component.error.subscribe((message) => {
|
||||
expect(message).toBe('CORE.MESSAGES.ERRORS.GENERIC');
|
||||
done();
|
||||
});
|
||||
|
@ -53,14 +53,8 @@ describe('InfiniteSelectScrollDirective', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [
|
||||
MatSelectModule,
|
||||
NoopAnimationsModule
|
||||
],
|
||||
declarations: [
|
||||
TestComponent,
|
||||
InfiniteSelectScrollDirective
|
||||
]
|
||||
imports: [MatSelectModule, NoopAnimationsModule, InfiniteSelectScrollDirective],
|
||||
declarations: [TestComponent]
|
||||
});
|
||||
fixture = TestBed.createComponent(TestComponent);
|
||||
component = fixture.componentInstance;
|
||||
|
Loading…
x
Reference in New Issue
Block a user