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(completedTaskName);
|
||||||
await tasksCloudDemoPage.taskListCloudComponent().checkContentIsNotDisplayedByName(createdTaskName);
|
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 { EditTaskFilterCloudComponent } from './edit-task-filter-cloud.component';
|
||||||
import { TaskFilterCloudService } from '../services/task-filter-cloud.service';
|
import { TaskFilterCloudService } from '../services/task-filter-cloud.service';
|
||||||
import { TaskFilterDialogCloudComponent } from './task-filter-dialog-cloud.component';
|
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 { AbstractControl } from '@angular/forms';
|
||||||
import moment from 'moment-es6';
|
import moment from 'moment-es6';
|
||||||
|
|
||||||
@ -74,7 +74,7 @@ describe('EditTaskFilterCloudComponent', () => {
|
|||||||
|
|
||||||
it('should fetch task filter by taskId', () => {
|
it('should fetch task filter by taskId', () => {
|
||||||
const taskFilterIdChange = new SimpleChange(undefined, 'mock-task-filter-id', true);
|
const taskFilterIdChange = new SimpleChange(undefined, 'mock-task-filter-id', true);
|
||||||
component.ngOnChanges({ 'id': taskFilterIdChange});
|
component.ngOnChanges({ 'id': taskFilterIdChange });
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
fixture.whenStable().then(() => {
|
fixture.whenStable().then(() => {
|
||||||
expect(getTaskFilterSpy).toHaveBeenCalled();
|
expect(getTaskFilterSpy).toHaveBeenCalled();
|
||||||
@ -88,7 +88,7 @@ describe('EditTaskFilterCloudComponent', () => {
|
|||||||
|
|
||||||
it('should display filter name as title', async(() => {
|
it('should display filter name as title', async(() => {
|
||||||
const taskFilterIdChange = new SimpleChange(undefined, 'mock-task-filter-id', true);
|
const taskFilterIdChange = new SimpleChange(undefined, 'mock-task-filter-id', true);
|
||||||
component.ngOnChanges({ 'id': taskFilterIdChange});
|
component.ngOnChanges({ 'id': taskFilterIdChange });
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
const title = fixture.debugElement.nativeElement.querySelector('#adf-edit-task-filter-title-id');
|
const title = fixture.debugElement.nativeElement.querySelector('#adf-edit-task-filter-title-id');
|
||||||
const subTitle = fixture.debugElement.nativeElement.querySelector('#adf-edit-task-filter-sub-title-id');
|
const subTitle = fixture.debugElement.nativeElement.querySelector('#adf-edit-task-filter-sub-title-id');
|
||||||
@ -132,12 +132,12 @@ describe('EditTaskFilterCloudComponent', () => {
|
|||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
const taskFilterIdChange = new SimpleChange(undefined, 'mock-task-filter-id', true);
|
const taskFilterIdChange = new SimpleChange(undefined, 'mock-task-filter-id', true);
|
||||||
component.ngOnChanges({'id': taskFilterIdChange});
|
component.ngOnChanges({ 'id': taskFilterIdChange });
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should defined editTaskFilter form ', () => {
|
it('should defined editTaskFilter form ', () => {
|
||||||
expect(component.editTaskFilterForm).toBeDefined();
|
expect(component.editTaskFilterForm).toBeDefined();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should create editTaskFilter form with default properties', async(() => {
|
it('should create editTaskFilter form with default properties', async(() => {
|
||||||
@ -214,27 +214,7 @@ describe('EditTaskFilterCloudComponent', () => {
|
|||||||
});
|
});
|
||||||
}));
|
}));
|
||||||
|
|
||||||
it('should display status drop down', async(() => {
|
it('should display all the statuses that are defined in the task filter', 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();
|
|
||||||
|
|
||||||
const expansionPanel = fixture.debugElement.nativeElement.querySelector('mat-expansion-panel-header');
|
const expansionPanel = fixture.debugElement.nativeElement.querySelector('mat-expansion-panel-header');
|
||||||
expansionPanel.click();
|
expansionPanel.click();
|
||||||
@ -244,9 +224,14 @@ describe('EditTaskFilterCloudComponent', () => {
|
|||||||
stateElement.click();
|
stateElement.click();
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
|
|
||||||
fixture.whenStable().then(() => {
|
const statusOptions = fixture.debugElement.queryAll(By.css('[data-automation-id="adf-cloud-edit-task-property-options-status"]'));
|
||||||
expect(stateElement.textContent.trim()).toBe('ALL');
|
|
||||||
});
|
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(() => {
|
it('should display sort drop down', async(() => {
|
||||||
@ -279,7 +264,7 @@ describe('EditTaskFilterCloudComponent', () => {
|
|||||||
|
|
||||||
it('should able to build a editTaskFilter form with default properties if input is empty', async(() => {
|
it('should able to build a editTaskFilter form with default properties if input is empty', async(() => {
|
||||||
const taskFilterIdChange = new SimpleChange(undefined, 'mock-task-filter-id', true);
|
const taskFilterIdChange = new SimpleChange(undefined, 'mock-task-filter-id', true);
|
||||||
component.ngOnChanges({ 'id': taskFilterIdChange});
|
component.ngOnChanges({ 'id': taskFilterIdChange });
|
||||||
component.filterProperties = [];
|
component.filterProperties = [];
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
const stateController = component.editTaskFilterForm.get('status');
|
const stateController = component.editTaskFilterForm.get('status');
|
||||||
@ -303,7 +288,7 @@ describe('EditTaskFilterCloudComponent', () => {
|
|||||||
component.filterProperties = ['appName', 'processInstanceId', 'priority'];
|
component.filterProperties = ['appName', 'processInstanceId', 'priority'];
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
const taskFilterIdChange = new SimpleChange(undefined, 'mock-task-filter-id', true);
|
const taskFilterIdChange = new SimpleChange(undefined, 'mock-task-filter-id', true);
|
||||||
component.ngOnChanges({ 'id': taskFilterIdChange});
|
component.ngOnChanges({ 'id': taskFilterIdChange });
|
||||||
const appController = component.editTaskFilterForm.get('appName');
|
const appController = component.editTaskFilterForm.get('appName');
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
fixture.whenStable().then(() => {
|
fixture.whenStable().then(() => {
|
||||||
@ -318,7 +303,7 @@ describe('EditTaskFilterCloudComponent', () => {
|
|||||||
|
|
||||||
it('should display default sort properties', async(() => {
|
it('should display default sort properties', async(() => {
|
||||||
const taskFilterIdChange = new SimpleChange(undefined, 'mock-task-filter-id', true);
|
const taskFilterIdChange = new SimpleChange(undefined, 'mock-task-filter-id', true);
|
||||||
component.ngOnChanges({ 'id': taskFilterIdChange});
|
component.ngOnChanges({ 'id': taskFilterIdChange });
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
const expansionPanel = fixture.debugElement.nativeElement.querySelector('mat-expansion-panel-header');
|
const expansionPanel = fixture.debugElement.nativeElement.querySelector('mat-expansion-panel-header');
|
||||||
expansionPanel.click();
|
expansionPanel.click();
|
||||||
@ -344,7 +329,7 @@ describe('EditTaskFilterCloudComponent', () => {
|
|||||||
}));
|
}));
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
const taskFilterIdChange = new SimpleChange(undefined, 'mock-task-filter-id', true);
|
const taskFilterIdChange = new SimpleChange(undefined, 'mock-task-filter-id', true);
|
||||||
component.ngOnChanges({ 'id': taskFilterIdChange});
|
component.ngOnChanges({ 'id': taskFilterIdChange });
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
const expansionPanel = fixture.debugElement.nativeElement.querySelector('mat-expansion-panel-header');
|
const expansionPanel = fixture.debugElement.nativeElement.querySelector('mat-expansion-panel-header');
|
||||||
expansionPanel.click();
|
expansionPanel.click();
|
||||||
@ -365,7 +350,7 @@ describe('EditTaskFilterCloudComponent', () => {
|
|||||||
|
|
||||||
it('should display default sort properties if input is empty', async(() => {
|
it('should display default sort properties if input is empty', async(() => {
|
||||||
const taskFilterIdChange = new SimpleChange(undefined, 'mock-task-filter-id', true);
|
const taskFilterIdChange = new SimpleChange(undefined, 'mock-task-filter-id', true);
|
||||||
component.ngOnChanges({ 'id': taskFilterIdChange});
|
component.ngOnChanges({ 'id': taskFilterIdChange });
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
component.sortProperties = [];
|
component.sortProperties = [];
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
@ -390,7 +375,7 @@ describe('EditTaskFilterCloudComponent', () => {
|
|||||||
it('should display default filter actions', async(() => {
|
it('should display default filter actions', async(() => {
|
||||||
component.toggleFilterActions = true;
|
component.toggleFilterActions = true;
|
||||||
const taskFilterIdChange = new SimpleChange(undefined, 'mock-task-filter-id', true);
|
const taskFilterIdChange = new SimpleChange(undefined, 'mock-task-filter-id', true);
|
||||||
component.ngOnChanges({ 'id': taskFilterIdChange});
|
component.ngOnChanges({ 'id': taskFilterIdChange });
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
const expansionPanel = fixture.debugElement.nativeElement.querySelector('mat-expansion-panel-header');
|
const expansionPanel = fixture.debugElement.nativeElement.querySelector('mat-expansion-panel-header');
|
||||||
expansionPanel.click();
|
expansionPanel.click();
|
||||||
@ -414,7 +399,7 @@ describe('EditTaskFilterCloudComponent', () => {
|
|||||||
component.actions = ['save'];
|
component.actions = ['save'];
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
const taskFilterIdChange = new SimpleChange(undefined, 'mock-task-filter-id', true);
|
const taskFilterIdChange = new SimpleChange(undefined, 'mock-task-filter-id', true);
|
||||||
component.ngOnChanges({ 'id': taskFilterIdChange});
|
component.ngOnChanges({ 'id': taskFilterIdChange });
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
component.toggleFilterActions = true;
|
component.toggleFilterActions = true;
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
@ -434,7 +419,7 @@ describe('EditTaskFilterCloudComponent', () => {
|
|||||||
component.toggleFilterActions = true;
|
component.toggleFilterActions = true;
|
||||||
component.actions = [];
|
component.actions = [];
|
||||||
const taskFilterIdChange = new SimpleChange(undefined, 'mock-task-filter-id', true);
|
const taskFilterIdChange = new SimpleChange(undefined, 'mock-task-filter-id', true);
|
||||||
component.ngOnChanges({ 'id': taskFilterIdChange});
|
component.ngOnChanges({ 'id': taskFilterIdChange });
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
const expansionPanel = fixture.debugElement.nativeElement.querySelector('mat-expansion-panel-header');
|
const expansionPanel = fixture.debugElement.nativeElement.querySelector('mat-expansion-panel-header');
|
||||||
expansionPanel.click();
|
expansionPanel.click();
|
||||||
@ -458,7 +443,7 @@ describe('EditTaskFilterCloudComponent', () => {
|
|||||||
component.appName = 'fake';
|
component.appName = 'fake';
|
||||||
component.filterProperties = ['appName', 'processInstanceId', 'priority', 'lastModified'];
|
component.filterProperties = ['appName', 'processInstanceId', 'priority', 'lastModified'];
|
||||||
const taskFilterIdChange = new SimpleChange(undefined, 'mock-task-filter-id', true);
|
const taskFilterIdChange = new SimpleChange(undefined, 'mock-task-filter-id', true);
|
||||||
component.ngOnChanges({ 'id': taskFilterIdChange});
|
component.ngOnChanges({ 'id': taskFilterIdChange });
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
|
|
||||||
const lastModifiedToControl: AbstractControl = component.editTaskFilterForm.get('lastModifiedTo');
|
const lastModifiedToControl: AbstractControl = component.editTaskFilterForm.get('lastModifiedTo');
|
||||||
@ -482,7 +467,7 @@ describe('EditTaskFilterCloudComponent', () => {
|
|||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
const taskFilterIdChange = new SimpleChange(undefined, 'mock-task-filter-id', true);
|
const taskFilterIdChange = new SimpleChange(undefined, 'mock-task-filter-id', true);
|
||||||
component.ngOnChanges({ 'id': taskFilterIdChange});
|
component.ngOnChanges({ 'id': taskFilterIdChange });
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
|
|
||||||
});
|
});
|
||||||
|
@ -92,8 +92,9 @@ export class EditTaskFilterCloudComponent implements OnInit, OnChanges, OnDestro
|
|||||||
status = [
|
status = [
|
||||||
{ label: 'ALL', value: '' },
|
{ label: 'ALL', value: '' },
|
||||||
{ label: 'CREATED', value: 'CREATED' },
|
{ label: 'CREATED', value: 'CREATED' },
|
||||||
{ label: 'CANCELLED', value: 'CANCELLED' },
|
|
||||||
{ label: 'ASSIGNED', value: 'ASSIGNED' },
|
{ label: 'ASSIGNED', value: 'ASSIGNED' },
|
||||||
|
{ label: 'SUSPENDED', value: 'SUSPENDED' },
|
||||||
|
{ label: 'CANCELLED', value: 'CANCELLED' },
|
||||||
{ label: 'COMPLETED', value: 'COMPLETED' }
|
{ label: 'COMPLETED', value: 'COMPLETED' }
|
||||||
];
|
];
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user