Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 16 additions & 4 deletions tests/unit/ReportSecondaryActionUtilsTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -923,6 +923,9 @@ describe('getSecondaryAction', () => {
const TRANSACTION_ID = 'transaction_id';
await Onyx.merge(`${ONYXKEYS.COLLECTION.REPORT}${REPORT_ID}`, report);

// Use tomorrow's date to ensure we're always before the NACHA cutoff (23:45 UTC)
const tomorrow = new Date();
tomorrow.setDate(tomorrow.getDate() + 1);
const ACTION_ID = 'action_id';
const reportAction = {
actionID: ACTION_ID,
Expand All @@ -931,7 +934,7 @@ describe('getSecondaryAction', () => {
IOUTransactionID: TRANSACTION_ID,
type: CONST.IOU.REPORT_ACTION_TYPE.PAY,
},
created: new Date().toISOString(),
created: tomorrow.toISOString(),
} as unknown as ReportAction;
await Onyx.merge(`${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${REPORT_ID}`, {[ACTION_ID]: reportAction});

Expand Down Expand Up @@ -970,6 +973,9 @@ describe('getSecondaryAction', () => {
const TRANSACTION_ID = 'transaction_id';
await Onyx.merge(`${ONYXKEYS.COLLECTION.REPORT}${REPORT_ID}`, report);

// Use tomorrow's date to ensure we're always before the NACHA cutoff (23:45 UTC)
const tomorrow = new Date();
tomorrow.setDate(tomorrow.getDate() + 1);
const ACTION_ID = 'action_id';
const reportAction = {
actionID: ACTION_ID,
Expand All @@ -979,7 +985,7 @@ describe('getSecondaryAction', () => {
type: CONST.IOU.REPORT_ACTION_TYPE.PAY,
paymentType: CONST.IOU.PAYMENT_TYPE.VBBA,
},
created: new Date().toISOString(),
created: tomorrow.toISOString(),
} as unknown as ReportAction;
await Onyx.merge(`${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${REPORT_ID}`, {[ACTION_ID]: reportAction});

Expand Down Expand Up @@ -1018,6 +1024,9 @@ describe('getSecondaryAction', () => {
const TRANSACTION_ID = 'transaction_id';
await Onyx.merge(`${ONYXKEYS.COLLECTION.REPORT}${REPORT_ID}`, report);

// Use tomorrow's date to ensure we're always before the NACHA cutoff (23:45 UTC)
const tomorrow = new Date();
tomorrow.setDate(tomorrow.getDate() + 1);
const ACTION_ID = 'action_id';
const reportAction = {
actionID: ACTION_ID,
Expand All @@ -1027,7 +1036,7 @@ describe('getSecondaryAction', () => {
type: CONST.IOU.REPORT_ACTION_TYPE.PAY,
paymentType: CONST.IOU.PAYMENT_TYPE.VBBA,
},
created: new Date().toISOString(),
created: tomorrow.toISOString(),
} as unknown as ReportAction;
await Onyx.merge(`${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${REPORT_ID}`, {[ACTION_ID]: reportAction});

Expand Down Expand Up @@ -1066,6 +1075,9 @@ describe('getSecondaryAction', () => {
const TRANSACTION_ID = 'transaction_id';
await Onyx.merge(`${ONYXKEYS.COLLECTION.REPORT}${REPORT_ID}`, report);

// Use tomorrow's date to ensure we're always before the NACHA cutoff (23:45 UTC)
const tomorrow = new Date();
tomorrow.setDate(tomorrow.getDate() + 1);
const ACTION_ID = 'action_id';
const reportAction = {
actionID: ACTION_ID,
Expand All @@ -1075,7 +1087,7 @@ describe('getSecondaryAction', () => {
type: CONST.IOU.REPORT_ACTION_TYPE.PAY,
paymentType: CONST.IOU.PAYMENT_TYPE.VBBA,
},
created: new Date().toISOString(),
created: tomorrow.toISOString(),
} as unknown as ReportAction;
await Onyx.merge(`${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${REPORT_ID}`, {[ACTION_ID]: reportAction});

Expand Down
Loading