mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-31 17:38:48 +00:00
[APPS-2132] migrate components to date-fns (#9001)
* migrate edit process filter to date-fns * refresh unit tests * fix a11y for date-fns * Revert "fix a11y for date-fns" This reverts commit 2e706d4aed1b8a50d1de62fe11d9d528530d628c. * update e2e * start task fixes * cleanup code * remove fdescribe * remove moment, improve unit testing * remove dependency on date util * cleanup search date range component * cleanup code * migrate search date range component * revert e2e changes for now * extra fixes and tests * add missing functionality, extra tests * increase time constraints * improved code, disabled e2e * move e2e to unit tests, extra rework for insights * extra unit test for date range validation * migrate date-range to date-fns
This commit is contained in:
@@ -17,7 +17,6 @@
|
||||
|
||||
import { createApiService,
|
||||
AppListCloudPage,
|
||||
DateUtil,
|
||||
GroupIdentityService,
|
||||
IdentityService,
|
||||
LocalStorageUtil,
|
||||
@@ -67,17 +66,26 @@ describe('Process filters cloud', () => {
|
||||
const queryService = new QueryService(apiService);
|
||||
const tasksService = new TasksService(apiService);
|
||||
|
||||
const beforeDate = format(subDays(new Date(), 1), 'dd/MM/yyyy');
|
||||
const currentDate = DateUtil.formatDate('DD/MM/YYYY');
|
||||
const afterDate = format(addDays(new Date(), 1), 'dd/MM/yyyy');
|
||||
const beforeDate = format(subDays(new Date(), 2), 'dd/MM/yyyy');
|
||||
const currentDate = format(new Date(), 'dd/MM/yyyy');
|
||||
const afterDate = format(addDays(new Date(), 2), 'dd/MM/yyyy');
|
||||
const processListCloudConfiguration = new ProcessListCloudConfiguration();
|
||||
const editProcessFilterConfiguration = new EditProcessFilterConfiguration();
|
||||
const processListCloudConfigFile = processListCloudConfiguration.getConfiguration();
|
||||
const editProcessFilterConfigFile = editProcessFilterConfiguration.getConfiguration();
|
||||
|
||||
let completedProcess; let runningProcessInstance; let suspendProcessInstance; let testUser; let anotherUser; let groupInfo;
|
||||
let anotherProcessInstance; let processDefinition; let anotherProcessDefinition;
|
||||
let differentAppUserProcessInstance; let simpleAppProcessDefinition;
|
||||
let completedProcess: any;
|
||||
let runningProcessInstance: any;
|
||||
let suspendProcessInstance: any;
|
||||
let testUser: any;
|
||||
let anotherUser: any;
|
||||
let groupInfo: any;
|
||||
let anotherProcessInstance: any;
|
||||
let processDefinition: any;
|
||||
let anotherProcessDefinition: any;
|
||||
let differentAppUserProcessInstance: any;
|
||||
let simpleAppProcessDefinition: any;
|
||||
|
||||
const candidateBaseApp = browser.params.resources.ACTIVITI_CLOUD_APPS.CANDIDATE_BASE_APP.name;
|
||||
const simpleApp = browser.params.resources.ACTIVITI_CLOUD_APPS.SIMPLE_APP.name;
|
||||
|
||||
@@ -252,7 +260,7 @@ describe('Process filters cloud', () => {
|
||||
await processList.checkContentIsNotDisplayedByName(runningProcessInstance.entry.name);
|
||||
});
|
||||
|
||||
it('[C306892] Should be able to filter by process status - Running', async () => {
|
||||
it('[C306892-1] Should be able to filter by process status - Running', async () => {
|
||||
await editProcessFilter.openFilter();
|
||||
await editProcessFilter.setStatusFilterDropDown(PROCESS_STATUS.RUNNING);
|
||||
await processList.getDataTable().waitTillContentLoaded();
|
||||
@@ -269,7 +277,7 @@ describe('Process filters cloud', () => {
|
||||
await processList.checkContentIsNotDisplayedByName(completedProcess.entry.name);
|
||||
});
|
||||
|
||||
it('[C306892] Should be able to filter by process status - Completed', async () => {
|
||||
it('[C306892-2] Should be able to filter by process status - Completed', async () => {
|
||||
await editProcessFilter.openFilter();
|
||||
await editProcessFilter.setStatusFilterDropDown(PROCESS_STATUS.COMPLETED);
|
||||
await processList.getDataTable().waitTillContentLoaded();
|
||||
@@ -286,7 +294,7 @@ describe('Process filters cloud', () => {
|
||||
await processList.checkContentIsNotDisplayedByName(anotherProcessInstance.entry.name);
|
||||
});
|
||||
|
||||
it('[C306892] Should be able to filter by process status - Suspended', async () => {
|
||||
it('[C306892-3] Should be able to filter by process status - Suspended', async () => {
|
||||
await editProcessFilter.openFilter();
|
||||
await editProcessFilter.setStatusFilterDropDown(PROCESS_STATUS.SUSPENDED);
|
||||
await processList.getDataTable().waitTillContentLoaded();
|
||||
@@ -303,7 +311,7 @@ describe('Process filters cloud', () => {
|
||||
await processList.checkContentIsNotDisplayedByName(completedProcess.entry.name);
|
||||
});
|
||||
|
||||
it('[C306892] Should be able to filter by process status - All', async () => {
|
||||
it('[C306892-4] Should be able to filter by process status - All', async () => {
|
||||
await processCloudDemoPage.processFilterCloudComponent.clickAllProcessesFilter();
|
||||
|
||||
await editProcessFilter.openFilter();
|
||||
@@ -315,17 +323,17 @@ describe('Process filters cloud', () => {
|
||||
await processList.checkContentIsDisplayedByName(completedProcess.entry.name);
|
||||
});
|
||||
|
||||
it('[C311318] Should be able to filter by lastModifiedFrom - displays record when date = currentDate', async () => {
|
||||
it('[C311318-1] Should be able to filter by lastModifiedFrom - displays record when date = currentDate', async () => {
|
||||
await setProcessName(currentDate, 'lastModifiedFrom');
|
||||
await processList.checkContentIsDisplayedByName(runningProcessInstance.entry.name);
|
||||
});
|
||||
|
||||
it('[C311318] Should be able to filter by lastModifiedFrom - displays record when date = beforeDate', async () => {
|
||||
it('[C311318-2] Should be able to filter by lastModifiedFrom - displays record when date = beforeDate', async () => {
|
||||
await setProcessName(beforeDate, 'lastModifiedFrom');
|
||||
await processList.checkContentIsDisplayedByName(runningProcessInstance.entry.name);
|
||||
});
|
||||
|
||||
it('[C311318] Should be able to filter by lastModifiedFrom - does not display record when date = afterDate', async () => {
|
||||
it('[C311318-3] Should be able to filter by lastModifiedFrom - does not display record when date = afterDate', async () => {
|
||||
await editProcessFilter.openFilter();
|
||||
await editProcessFilter.setProcessName(runningProcessInstance.entry.name);
|
||||
await processList.getDataTable().waitTillContentLoaded();
|
||||
@@ -333,17 +341,17 @@ describe('Process filters cloud', () => {
|
||||
await processList.checkContentIsNotDisplayedByName(runningProcessInstance.entry.name);
|
||||
});
|
||||
|
||||
it('[C311319] Should be able to filter by lastModifiedTo - displays record when date = currentDate', async () => {
|
||||
it('[C311319-1] Should be able to filter by lastModifiedTo - displays record when date = currentDate', async () => {
|
||||
await setProcessName(currentDate);
|
||||
await processList.checkContentIsDisplayedByName(runningProcessInstance.entry.name);
|
||||
});
|
||||
|
||||
it('[C311319] Should be able to filter by lastModifiedTo - does not display record when date = beforeDate', async () => {
|
||||
it('[C311319-2] Should be able to filter by lastModifiedTo - does not display record when date = beforeDate', async () => {
|
||||
await setProcessName(beforeDate);
|
||||
await processList.checkContentIsNotDisplayedByName(runningProcessInstance.entry.name);
|
||||
});
|
||||
|
||||
it('[C311319] Should be able to filter by lastModifiedTo - displays record when date = afterDate', async () => {
|
||||
it('[C311319-3] Should be able to filter by lastModifiedTo - displays record when date = afterDate', async () => {
|
||||
await editProcessFilter.openFilter();
|
||||
await editProcessFilter.setProperty('lastModifiedTo', afterDate);
|
||||
await processList.getDataTable().waitTillContentLoaded();
|
||||
@@ -351,7 +359,7 @@ describe('Process filters cloud', () => {
|
||||
await processList.checkContentIsDisplayedByName(runningProcessInstance.entry.name);
|
||||
});
|
||||
|
||||
it('[C311319] Should not display any processes when the lastModifiedFrom and lastModifiedTo are set to a future date', async () => {
|
||||
it('[C311319-4] Should not display any processes when the lastModifiedFrom and lastModifiedTo are set to a future date', async () => {
|
||||
await editProcessFilter.openFilter();
|
||||
await editProcessFilter.setProperty('lastModifiedFrom', afterDate);
|
||||
await processList.getDataTable().waitTillContentLoaded();
|
||||
|
Reference in New Issue
Block a user