mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-31 17:38:48 +00:00
[ADF-4410] Upload dialog - remove delete action of version upload (#4618)
* undo remove node version implementation * clean up style * version upload row style * upload version row cells * update tests * fix aria label
This commit is contained in:
committed by
Eugenio Romano
parent
7826eea946
commit
cc53d96698
@@ -17,7 +17,7 @@
|
||||
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { TranslationService, FileUploadStatus, NodesApiService, UploadService,
|
||||
setupTestBed, CoreModule, AlfrescoApiService, AlfrescoApiServiceMock, FileModel, FileUploadOptions
|
||||
setupTestBed, CoreModule, AlfrescoApiService, AlfrescoApiServiceMock
|
||||
} from '@alfresco/adf-core';
|
||||
import { of, throwError } from 'rxjs';
|
||||
import { UploadModule } from '../upload.module';
|
||||
@@ -30,7 +30,6 @@ describe('FileUploadingListComponent', () => {
|
||||
let uploadService: UploadService;
|
||||
let nodesApiService: NodesApiService;
|
||||
let translateService: TranslationService;
|
||||
let alfrescoApiService: AlfrescoApiService;
|
||||
let file: any;
|
||||
|
||||
beforeEach(() => {
|
||||
@@ -56,7 +55,6 @@ describe('FileUploadingListComponent', () => {
|
||||
|
||||
translateService = TestBed.get(TranslationService);
|
||||
fixture = TestBed.createComponent(FileUploadingListComponent);
|
||||
alfrescoApiService = TestBed.get(AlfrescoApiService);
|
||||
component = fixture.componentInstance;
|
||||
|
||||
spyOn(translateService, 'get').and.returnValue(of('some error message'));
|
||||
@@ -108,30 +106,6 @@ describe('FileUploadingListComponent', () => {
|
||||
expect(uploadService.cancelUpload).toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it('should delete node version', () => {
|
||||
spyOn(alfrescoApiService.versionsApi, 'deleteVersion').and.returnValue(of(file));
|
||||
file = new FileModel(<File> { name: 'fake-name' });
|
||||
file.options = <FileUploadOptions> { newVersion: true };
|
||||
file.data = { entry: { id: 'nodeId', properties: { 'cm:versionLabel': '1' } } };
|
||||
|
||||
component.removeFile(file);
|
||||
|
||||
expect(alfrescoApiService.versionsApi.deleteVersion).toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it('should throw error when delete node version fails', (done) => {
|
||||
spyOn(alfrescoApiService.versionsApi, 'deleteVersion').and.returnValue(throwError(file));
|
||||
file = new FileModel(<File> { name: 'fake-name' });
|
||||
file.options = <FileUploadOptions> { newVersion: true };
|
||||
file.data = { entry: { id: 'nodeId', properties: { 'cm:versionLabel': '1' } } };
|
||||
|
||||
component.error.subscribe(() => {
|
||||
done();
|
||||
});
|
||||
|
||||
component.removeFile(file);
|
||||
});
|
||||
|
||||
describe('Events', () => {
|
||||
|
||||
it('should throw an error event if delete file goes wrong', (done) => {
|
||||
|
Reference in New Issue
Block a user