mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[ADF-5422] remove deprecated "async()" from unit tests (#7109)
* remove angualar async from content services * upgrade more tests * upgrade core tests * upgrade tests * fix deprecated constant * fix tests * fix after rebase
This commit is contained in:
@@ -16,7 +16,7 @@
|
||||
*/
|
||||
|
||||
import { EventEmitter } from '@angular/core';
|
||||
import { async, TestBed } from '@angular/core/testing';
|
||||
import { TestBed } from '@angular/core/testing';
|
||||
import { FileModel, FileUploadOptions, FileUploadStatus } from '../models/file.model';
|
||||
import { AppConfigModule } from '../app-config/app-config.module';
|
||||
import { UploadService } from './upload.service';
|
||||
@@ -447,32 +447,32 @@ describe('UploadService', () => {
|
||||
expect(result[0]).toBe(file2);
|
||||
});
|
||||
|
||||
it('should call onUploadDeleted if file was deleted', async(() => {
|
||||
it('should call onUploadDeleted if file was deleted', () => {
|
||||
const file = <any> ({ status: FileUploadStatus.Deleted });
|
||||
spyOn(service.fileUploadDeleted, 'next');
|
||||
|
||||
service.cancelUpload(file);
|
||||
|
||||
expect(service.fileUploadDeleted.next).toHaveBeenCalled();
|
||||
}));
|
||||
});
|
||||
|
||||
it('should call fileUploadError if file has error status', async(() => {
|
||||
it('should call fileUploadError if file has error status', () => {
|
||||
const file = <any> ({ status: FileUploadStatus.Error });
|
||||
spyOn(service.fileUploadError, 'next');
|
||||
|
||||
service.cancelUpload(file);
|
||||
|
||||
expect(service.fileUploadError.next).toHaveBeenCalled();
|
||||
}));
|
||||
});
|
||||
|
||||
it('should call fileUploadCancelled if file is in pending', async(() => {
|
||||
it('should call fileUploadCancelled if file is in pending', () => {
|
||||
const file = <any> ({ status: FileUploadStatus.Pending });
|
||||
spyOn(service.fileUploadCancelled, 'next');
|
||||
|
||||
service.cancelUpload(file);
|
||||
|
||||
expect(service.fileUploadCancelled.next).toHaveBeenCalled();
|
||||
}));
|
||||
});
|
||||
|
||||
it('Should not pass rendition if it is disabled', () => {
|
||||
mockProductInfo.next({ status: { isThumbnailGenerationEnabled: false } } as EcmProductVersionModel);
|
||||
|
Reference in New Issue
Block a user