Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
it('[C286447] Should display the task filter icon when a custom filter is added', async () => {
const newFilter: any = new UserProcessInstanceFilterRepresentation();
newFilter.name = 'New Task Filter with icon';
newFilter.appId = appId;
newFilter.icon = 'glyphicon-cloud';
newFilter.filter = { sort: 'created-desc', state: 'completed', assignment: 'involved' };
const result = await this.alfrescoJsApi.activiti.userFiltersApi.createUserTaskFilter(newFilter);
taskFilterId = result.id;
await browser.refresh();
await processServiceTabBarPage.clickSettingsButton();
await browser.sleep(500);
await appSettingsToggles.enableTaskFiltersIcon();
await processServiceTabBarPage.clickTasksButton();
await taskFiltersDemoPage.customTaskFilter('New Task Filter with icon').checkTaskFilterIsDisplayed();
it('[C277259] Should display tasks under new filter from oldest to newest when they are open', async () => {
const newFilter: any = new UserProcessInstanceFilterRepresentation();
newFilter.name = 'Newest last Open';
newFilter.appId = appId;
newFilter.icon = 'glyphicon-filter';
newFilter.filter = { sort: 'created-asc', state: 'open', assignment: 'involved' };
await this.alfrescoJsApi.activiti.userFiltersApi.createUserTaskFilter(newFilter);
await browser.refresh();
await taskFiltersDemoPage.customTaskFilter('Newest last Open').clickTaskFilter();
await expect(await tasksListPage.getDataTable().contentInPosition(1)).toBe(tasks[3].name);
await expect(await tasksListPage.getDataTable().contentInPosition(2)).toBe(tasks[4].name);
await expect(await tasksListPage.getDataTable().contentInPosition(3)).toBe(tasks[5].name);
});
browser.controlFlow().execute(() => {
let newFilter = new UserProcessInstanceFilterRepresentation();
newFilter.name = 'Task Filter Edited icon';
newFilter.appId = appId;
newFilter.icon = 'glyphicon-cloud';
newFilter.filter = { sort: 'created-desc', state: 'completed', assignment: 'involved' };
let result = this.alfrescoJsApi.activiti.userFiltersApi.updateUserTaskFilter(taskFilterId, newFilter);
return result;
});
browser.controlFlow().execute(async () => {
let newFilter = new UserProcessInstanceFilterRepresentation();
newFilter.name = 'New Task Filter';
newFilter.appId = appId;
newFilter.icon = 'glyphicon-filter';
newFilter.filter = { sort: 'created-desc', state: 'completed', assignment: 'involved' };
let result = await this.alfrescoJsApi.activiti.userFiltersApi.createUserTaskFilter(newFilter);
taskFilterId = result.id;
return result;
});