mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-05-26 17:24:56 +00:00
[ADF-4949] Add SUSPENDED state to the edit task filter (#5150)
* [ADF-4949] Add SUSPENDED state to the edit task filter * [ADF-4949] Add unit test * [ADF-4949] change order of status filters * [ADF-4949] Change order of status filters * [ADF-4949] Remove unnecessary unit test * [ADF-4949] Add e2e for SUSPENDED filter * [ADF-4949] fix lint errors
This commit is contained in:
parent
2ef6dc46e0
commit
a0858e3c86
@ -171,5 +171,23 @@ describe('Task filters cloud', () => {
|
||||
await tasksCloudDemoPage.taskListCloudComponent().checkContentIsNotDisplayedByName(completedTaskName);
|
||||
await tasksCloudDemoPage.taskListCloudComponent().checkContentIsNotDisplayedByName(createdTaskName);
|
||||
});
|
||||
|
||||
it('[C317658] Should display only tasks with Suspended status when SUSPENDED is selected from status dropdown', async () => {
|
||||
const processDefinition = await processDefinitionService
|
||||
.getProcessDefinitionByName(browser.params.resources.ACTIVITI7_APPS.SIMPLE_APP.processes.dropdownrestprocess, simpleApp);
|
||||
|
||||
const processInstance = await processInstancesService.createProcessInstance(processDefinition.entry.key, simpleApp);
|
||||
|
||||
const taskAssigned = await queryService.getProcessInstanceTasks(processInstance.entry.id, simpleApp);
|
||||
|
||||
await processInstancesService.suspendProcessInstance(processInstance.entry.id, simpleApp);
|
||||
|
||||
await tasksCloudDemoPage.editTaskFilterCloudComponent().openFilter();
|
||||
await tasksCloudDemoPage.editTaskFilterCloudComponent().clearAssignee();
|
||||
await tasksCloudDemoPage.editTaskFilterCloudComponent().setStatusFilterDropDown('SUSPENDED');
|
||||
|
||||
await tasksCloudDemoPage.taskListCloudComponent().checkContentIsDisplayedByName(taskAssigned.list.entries[0].entry.name);
|
||||
|
||||
});
|
||||
});
|
||||
});
|
||||
|
@ -31,7 +31,7 @@ import { TaskFiltersCloudModule } from '../task-filters-cloud.module';
|
||||
import { EditTaskFilterCloudComponent } from './edit-task-filter-cloud.component';
|
||||
import { TaskFilterCloudService } from '../services/task-filter-cloud.service';
|
||||
import { TaskFilterDialogCloudComponent } from './task-filter-dialog-cloud.component';
|
||||
import { fakeFilter, fakeAllTaskFilter } from '../mock/task-filters-cloud.mock';
|
||||
import { fakeFilter } from '../mock/task-filters-cloud.mock';
|
||||
import { AbstractControl } from '@angular/forms';
|
||||
import moment from 'moment-es6';
|
||||
|
||||
@ -214,27 +214,7 @@ describe('EditTaskFilterCloudComponent', () => {
|
||||
});
|
||||
}));
|
||||
|
||||
it('should display status drop down', async(() => {
|
||||
fixture.detectChanges();
|
||||
const expansionPanel = fixture.debugElement.nativeElement.querySelector('mat-expansion-panel-header');
|
||||
expansionPanel.click();
|
||||
fixture.detectChanges();
|
||||
const stateElement = fixture.debugElement.nativeElement.querySelector('[data-automation-id="adf-cloud-edit-task-property-status"] .mat-select-trigger');
|
||||
stateElement.click();
|
||||
fixture.detectChanges();
|
||||
fixture.whenStable().then(() => {
|
||||
const statusOptions = fixture.debugElement.queryAll(By.css('.mat-option-text'));
|
||||
expect(statusOptions.length).toEqual(5);
|
||||
});
|
||||
}));
|
||||
|
||||
it('should select \'All\' option in Task Status if All filter is set', async(() => {
|
||||
|
||||
getTaskFilterSpy.and.returnValue(of(fakeAllTaskFilter));
|
||||
|
||||
const taskFilterIdChange = new SimpleChange(undefined, 'mock-task-filter-id', true);
|
||||
component.ngOnChanges({ 'id': taskFilterIdChange});
|
||||
fixture.detectChanges();
|
||||
it('should display all the statuses that are defined in the task filter', async(() => {
|
||||
|
||||
const expansionPanel = fixture.debugElement.nativeElement.querySelector('mat-expansion-panel-header');
|
||||
expansionPanel.click();
|
||||
@ -244,9 +224,14 @@ describe('EditTaskFilterCloudComponent', () => {
|
||||
stateElement.click();
|
||||
fixture.detectChanges();
|
||||
|
||||
fixture.whenStable().then(() => {
|
||||
expect(stateElement.textContent.trim()).toBe('ALL');
|
||||
});
|
||||
const statusOptions = fixture.debugElement.queryAll(By.css('[data-automation-id="adf-cloud-edit-task-property-options-status"]'));
|
||||
|
||||
expect(statusOptions[0].nativeElement.textContent.trim()).toBe('ALL');
|
||||
expect(statusOptions[1].nativeElement.textContent.trim()).toBe('CREATED');
|
||||
expect(statusOptions[2].nativeElement.textContent.trim()).toBe('ASSIGNED');
|
||||
expect(statusOptions[3].nativeElement.textContent.trim()).toBe('SUSPENDED');
|
||||
expect(statusOptions[4].nativeElement.textContent.trim()).toBe('CANCELLED');
|
||||
expect(statusOptions[5].nativeElement.textContent.trim()).toBe('COMPLETED');
|
||||
}));
|
||||
|
||||
it('should display sort drop down', async(() => {
|
||||
|
@ -92,8 +92,9 @@ export class EditTaskFilterCloudComponent implements OnInit, OnChanges, OnDestro
|
||||
status = [
|
||||
{ label: 'ALL', value: '' },
|
||||
{ label: 'CREATED', value: 'CREATED' },
|
||||
{ label: 'CANCELLED', value: 'CANCELLED' },
|
||||
{ label: 'ASSIGNED', value: 'ASSIGNED' },
|
||||
{ label: 'SUSPENDED', value: 'SUSPENDED' },
|
||||
{ label: 'CANCELLED', value: 'CANCELLED' },
|
||||
{ label: 'COMPLETED', value: 'COMPLETED' }
|
||||
];
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user