diff --git a/e2e/protractor/suites/search/search-filters.test.ts b/e2e/protractor/suites/search/search-filters.test.ts index 6eb1e792ee..2c9574759c 100644 --- a/e2e/protractor/suites/search/search-filters.test.ts +++ b/e2e/protractor/suites/search/search-filters.test.ts @@ -33,8 +33,9 @@ import { SITE_ROLES, SizeOperator } from '@alfresco/aca-testing-shared'; +import { DateFnsUtils } from '@alfresco/adf-core'; import { BrowserActions } from '@alfresco/adf-testing'; -import { addDays, format, subDays } from 'date-fns'; +import { addDays, subDays } from 'date-fns'; describe('Search filters', () => { const random = Utils.random(); @@ -161,9 +162,9 @@ describe('Search filters', () => { }); describe('Filter by Created date', () => { - const yesterday = format(subDays(new Date(), 1), 'dd-MMM-yy'); - const today = format(new Date(), 'dd-MMM-yy'); - const future = format(addDays(new Date(), 1), 'dd-MMM-yy'); + const yesterday = DateFnsUtils.formatDate(subDays(new Date(), 1), 'DD-MMM-YY'); + const today = DateFnsUtils.formatDate(new Date(), 'DD-MMM-YY'); + const future = DateFnsUtils.formatDate(addDays(new Date(), 1), 'DD-MMM-YY'); afterEach(async () => { await Utils.pressEscape(); diff --git a/e2e/protractor/suites/search/search-results-files-folders.test.ts b/e2e/protractor/suites/search/search-results-files-folders.test.ts index 73ed3ff7ce..beca0c0b1c 100644 --- a/e2e/protractor/suites/search/search-results-files-folders.test.ts +++ b/e2e/protractor/suites/search/search-results-files-folders.test.ts @@ -23,7 +23,7 @@ */ import { AdminActions, LoginPage, SearchResultsPage, RepoClient, Utils } from '@alfresco/aca-testing-shared'; -import { format } from 'date-fns'; +import { DateFnsUtils } from '@alfresco/adf-core'; describe('Search results - files and folders', () => { const random = Utils.random(); @@ -92,7 +92,7 @@ describe('Search results - files and folders', () => { await dataTable.waitForBody(); const fileEntry = await apis.user.nodes.getNodeById(fileId); - const modifiedDate = format(fileEntry.entry.modifiedAt, 'MMM d, yyyy, h:mm:ss aa'); + const modifiedDate = DateFnsUtils.formatDate(fileEntry.entry.modifiedAt, 'MMM D, YYYY, h:mm:ss A'); const modifiedBy = fileEntry.entry.modifiedByUser.displayName; const size = fileEntry.entry.content.sizeInBytes; @@ -114,7 +114,7 @@ describe('Search results - files and folders', () => { await dataTable.waitForBody(); const folderEntry = await apis.user.nodes.getNodeById(folderId); - const modifiedDate = format(folderEntry.entry.modifiedAt, 'MMM d, yyyy, h:mm:ss aa'); + const modifiedDate = DateFnsUtils.formatDate(folderEntry.entry.modifiedAt, 'MMM D, YYYY, h:mm:ss A'); const modifiedBy = folderEntry.entry.modifiedByUser.displayName; expect(await dataTable.isItemPresent(folder)).toBe(true, `${folder} is not displayed`);