mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[ADF-3409] [ADF-3413] Standalone task - Attach/Remove forms bugs (#3670)
* Fix 3409 disable button logic Fix 3413 change the formName based on selected form * [ADF-3409] fixed missing import * [ADF-3409] fixed Observable.of in of
This commit is contained in:
committed by
Eugenio Romano
parent
e1d5ef6ee9
commit
8330ed2879
@@ -25,7 +25,7 @@ import { CommentProcessService, LogService, AuthenticationService } from '@alfre
|
||||
|
||||
import { UserProcessModel } from '@alfresco/adf-core';
|
||||
import { TaskDetailsModel } from '../models/task-details.model';
|
||||
import { noDataMock, taskDetailsMock, taskFormMock, tasksMock, taskDetailsWithOutAssigneeMock } from '../../mock';
|
||||
import { noDataMock, taskDetailsMock, standaloneTaskWithForm, standaloneTaskWithoutForm, taskFormMock, tasksMock, taskDetailsWithOutAssigneeMock } from '../../mock';
|
||||
import { TaskListService } from './../services/tasklist.service';
|
||||
import { TaskDetailsComponent } from './task-details.component';
|
||||
import { ProcessTestingModule } from '../../testing/process.testing.module';
|
||||
@@ -151,25 +151,40 @@ describe('TaskDetailsComponent', () => {
|
||||
|
||||
it('should display task standalone component when the task does not have an associated form', async(() => {
|
||||
component.taskId = '123';
|
||||
getTaskDetailsSpy.and.returnValue(of(standaloneTaskWithoutForm));
|
||||
|
||||
fixture.detectChanges();
|
||||
fixture.whenStable().then(() => {
|
||||
fixture.detectChanges();
|
||||
expect(component.isStandaloneTaskWithoutForm()).toBeTruthy();
|
||||
expect(fixture.debugElement.query(By.css('adf-task-standalone'))).not.toBeNull();
|
||||
});
|
||||
}));
|
||||
|
||||
it('should not display task standalone component when the task have an associated form', async(() => {
|
||||
it('should not display task standalone component when the task has a form', async(() => {
|
||||
component.taskId = '123';
|
||||
component.taskDetails = new TaskDetailsModel(taskDetailsMock);
|
||||
component.taskDetails.formKey = '10';
|
||||
getTaskDetailsSpy.and.returnValue(of(standaloneTaskWithForm));
|
||||
fixture.detectChanges();
|
||||
fixture.whenStable().then(() => {
|
||||
fixture.detectChanges();
|
||||
expect(component.isStandaloneTaskWithForm()).toBeTruthy();
|
||||
expect(fixture.debugElement.query(By.css('adf-task-standalone'))).toBeDefined();
|
||||
expect(fixture.debugElement.query(By.css('adf-task-standalone'))).not.toBeNull();
|
||||
});
|
||||
}));
|
||||
|
||||
it('should display the AttachFormComponent when standaloneTaskWithForm and click on attach button', async(() => {
|
||||
component.taskId = '123';
|
||||
getTaskDetailsSpy.and.returnValue(of(standaloneTaskWithForm));
|
||||
fixture.detectChanges();
|
||||
component.onShowAttachForm();
|
||||
fixture.whenStable().then(() => {
|
||||
fixture.detectChanges();
|
||||
expect(component.isStandaloneTaskWithForm()).toBeTruthy();
|
||||
expect(fixture.debugElement.query(By.css('adf-attach-form'))).toBeDefined();
|
||||
});
|
||||
}));
|
||||
|
||||
it('should display the claim message when the task is not assigned', async(() => {
|
||||
component.taskDetails = taskDetailsWithOutAssigneeMock;
|
||||
fixture.detectChanges();
|
||||
|
Reference in New Issue
Block a user