[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:
Cilibiu Bogdan
2019-04-18 16:36:37 +03:00
committed by Eugenio Romano
parent 7826eea946
commit cc53d96698
8 changed files with 43 additions and 79 deletions

View File

@@ -16,7 +16,7 @@
*/
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { FileModel, CoreModule, FileUploadOptions } from '@alfresco/adf-core';
import { FileModel, CoreModule, FileUploadOptions, FileUploadStatus } from '@alfresco/adf-core';
import { UploadModule } from '../upload.module';
import { FileUploadingListRowComponent } from './file-uploading-list-row.component';
@@ -70,4 +70,18 @@ describe('FileUploadingListRowComponent', () => {
'.adf-file-uploading-row__version'
).textContent).toContain('1');
});
it('should not emit remove event on a version file', () => {
spyOn(component.remove, 'emit');
component.file = new FileModel(<File> { name: 'fake-name' });
component.file.options = <FileUploadOptions> { newVersion: true };
component.file.data = { entry: { properties: { 'cm:versionLabel': '1' } } };
component.file.status = FileUploadStatus.Complete;
fixture.detectChanges();
const uploadCompleteIcon = document.querySelector('.adf-file-uploading-row__file-version .adf-file-uploading-row__status--done');
uploadCompleteIcon.dispatchEvent(new MouseEvent('click'));
expect(component.remove.emit).not.toHaveBeenCalled();
});
});