Disable the attachment component when the task/process is completed (#2351)

This commit is contained in:
Maurizio Vitale
2017-09-19 13:36:05 +01:00
committed by Eugenio Romano
parent d7bd9aa50b
commit 7a31a16178
6 changed files with 61 additions and 6 deletions

View File

@@ -231,6 +231,24 @@ describe('ProcessAttachmentListComponent', () => {
});
}));
it('should not show the empty list drag and drop component when is disabled', async(() => {
getProcessRelatedContentSpy.and.returnValue(Observable.of({
'size': 0,
'total': 0,
'start': 0,
'data': []
}));
let change = new SimpleChange(null, '123', true);
component.ngOnChanges({'processInstanceId': change});
component.disabled = true;
fixture.whenStable().then(() => {
fixture.detectChanges();
expect(fixture.nativeElement.querySelector('adf-empty-list .adf-empty-list-drag_drop')).toBeNull();
expect(fixture.nativeElement.querySelector('div[adf-empty-list-header]').innerText.trim()).toEqual('PROCESS-ATTACHMENT.EMPTY.HEADER');
});
}));
it('should show the empty list component when the attachments list is empty for completed process', async(() => {
getProcessRelatedContentSpy.and.returnValue(Observable.of({
'size': 0,

View File

@@ -222,6 +222,24 @@ describe('TaskAttachmentList', () => {
});
}));
it('should not show the empty list drag and drop component when is disabled', async(() => {
getTaskRelatedContentSpy.and.returnValue(Observable.of({
'size': 0,
'total': 0,
'start': 0,
'data': []
}));
let change = new SimpleChange(null, '123', true);
component.ngOnChanges({'taskId': change});
component.disabled = true;
fixture.whenStable().then(() => {
fixture.detectChanges();
expect(fixture.nativeElement.querySelector('adf-empty-list .adf-empty-list-drag_drop')).toBeNull();
expect(fixture.nativeElement.querySelector('div[adf-empty-list-header]').innerText.trim()).toEqual('TASK-ATTACHMENT.EMPTY.HEADER');
});
}));
it('should show the empty list component when the attachments list is empty for completed task', async(() => {
getTaskRelatedContentSpy.and.returnValue(Observable.of({
'size': 0,