Skip to content

Commit

Permalink
cr changes
Browse files Browse the repository at this point in the history
  • Loading branch information
OlimpiaZurek committed Jan 31, 2024
1 parent e5ebfbb commit 68070e8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
2 changes: 1 addition & 1 deletion tests/perf-test/ReportScreen.perf-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down
7 changes: 2 additions & 5 deletions tests/utils/collections/reportActions.ts
Original file line number Diff line number Diff line change
@@ -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';

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

0 comments on commit 68070e8

Please sign in to comment.