From 68070e8e3512ca50fe27fd5e6eb92757c8a02b04 Mon Sep 17 00:00:00 2001 From: Github Date: Wed, 31 Jan 2024 16:09:52 +0100 Subject: [PATCH] cr changes --- tests/perf-test/ReportScreen.perf-test.js | 2 +- tests/utils/collections/reportActions.ts | 7 ++----- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/tests/perf-test/ReportScreen.perf-test.js b/tests/perf-test/ReportScreen.perf-test.js index f5bc3f985227..dbc7775d066e 100644 --- a/tests/perf-test/ReportScreen.perf-test.js +++ b/tests/perf-test/ReportScreen.perf-test.js @@ -247,7 +247,7 @@ test('[ReportScreen] should press of the report item', () => { await act(triggerTransitionEnd); - // // Query for the report list + // Query for the report list await screen.findByTestId('report-actions-list'); const hintReportPreviewText = Localize.translateLocal('iou.viewDetails'); diff --git a/tests/utils/collections/reportActions.ts b/tests/utils/collections/reportActions.ts index 4efff8b3748a..bb14a2c7a41b 100644 --- a/tests/utils/collections/reportActions.ts +++ b/tests/utils/collections/reportActions.ts @@ -1,4 +1,5 @@ import {rand, randAggregation, randBoolean, randWord} from '@ngneat/falso'; +import {format} from 'date-fns'; import CONST from '@src/CONST'; import type {ReportAction} from '@src/types/onyx'; @@ -17,15 +18,11 @@ const flattenActionNamesValues = (actionNames: any) => { return result; }; -const addZero = (value: number): string | number => (value < 10 ? `0${value}` : value); - const getRandomDate = (): string => { const randomTimestamp = Math.random() * new Date().getTime(); const randomDate = new Date(randomTimestamp); - const formattedDate = `${randomDate.getFullYear()}-${addZero(randomDate.getMonth() + 1)}-${addZero(randomDate.getDate())} ${addZero(randomDate.getHours())}:${addZero( - randomDate.getMinutes(), - )}:${addZero(randomDate.getSeconds())}.${randomDate.getMilliseconds()}`; + const formattedDate = format(randomDate, CONST.DATE.FNS_DB_FORMAT_STRING); return formattedDate; };