Skip to content

Commit d60d255

Browse files
committed
refactor code
1 parent c7e7521 commit d60d255

1 file changed

Lines changed: 8 additions & 10 deletions

File tree

tests/actions/IOUTest.ts

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6419,7 +6419,7 @@ describe('actions/IOU', () => {
64196419
stateNum: CONST.REPORT.STATE_NUM.SUBMITTED,
64206420
statusNum: CONST.REPORT.STATUS_NUM.SUBMITTED,
64216421
managerID: RORY_ACCOUNT_ID,
6422-
chatType: 'policyExpenseChat',
6422+
chatType: CONST.REPORT.CHAT_TYPE.POLICY_EXPENSE_CHAT,
64236423
};
64246424
const fakeTransaction1: Transaction = {
64256425
...createRandomTransaction(0),
@@ -6430,7 +6430,7 @@ describe('actions/IOU', () => {
64306430
const fakeTransaction2: Transaction = {
64316431
...createRandomTransaction(1),
64326432
reportID,
6433-
amount: 0,
6433+
amount: 27,
64346434
receipt: {
64356435
source: 'test',
64366436
state: CONST.IOU.RECEIPT_STATE.SCAN_FAILED,
@@ -6458,18 +6458,16 @@ describe('actions/IOU', () => {
64586458
reportActionID: '0',
64596459
actionName: CONST.REPORT.ACTIONS.TYPE.REPORT_PREVIEW,
64606460
created: '2024-08-08 18:70:44.171',
6461-
childReportID: '1',
6461+
childReportID: reportID,
64626462
};
64636463

64646464
const MOCK_REPORT_ACTIONS: ReportActions = {
6465-
// eslint-disable-next-line @typescript-eslint/naming-convention
6466-
'0': deletedReportAction,
6467-
// eslint-disable-next-line @typescript-eslint/naming-convention
6468-
'1': {
6469-
reportActionID: '1',
6465+
[deletedReportAction.reportActionID]: deletedReportAction,
6466+
[reportID]: {
6467+
reportActionID: reportID,
64706468
actionName: CONST.REPORT.ACTIONS.TYPE.REPORT_PREVIEW,
64716469
created: '2024-08-08 19:70:44.171',
6472-
childReportID: '1',
6470+
childReportID: reportID,
64736471
message: [
64746472
{
64756473
type: 'TEXT',
@@ -6481,7 +6479,7 @@ describe('actions/IOU', () => {
64816479

64826480
await Onyx.set(`${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${fakeReport.reportID}`, MOCK_REPORT_ACTIONS);
64836481

6484-
expect(getIOUReportActionToApproveOrPay(fakeReport, '3')).toMatchObject(MOCK_REPORT_ACTIONS['1']);
6482+
expect(getIOUReportActionToApproveOrPay(fakeReport, undefined)).toMatchObject(MOCK_REPORT_ACTIONS[reportID]);
64856483
});
64866484
});
64876485
});

0 commit comments

Comments
 (0)