Skip to content

Commit

Permalink
[APPS-2171][APPS-2172] Migration from moment to date-fns (#3459)
Browse files Browse the repository at this point in the history
  • Loading branch information
arohilaGL authored Oct 4, 2023
1 parent 9a478ad commit 72c6ad0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
9 changes: 5 additions & 4 deletions e2e/protractor/suites/search/search-filters.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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;

Expand All @@ -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`);
Expand Down

0 comments on commit 72c6ad0

Please sign in to comment.