Skip to content

Commit

Permalink
fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
mkzie2 committed Dec 26, 2024
1 parent 8af96e6 commit 7db6695
Showing 1 changed file with 21 additions and 9 deletions.
30 changes: 21 additions & 9 deletions tests/unit/ReportUtilsTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -545,7 +545,10 @@ describe('ReportUtils', () => {
parentReportID: '101',
policyID: paidPolicy.id,
};
const moneyRequestOptions = ReportUtils.temporary_getMoneyRequestOptions(report, paidPolicy, [currentUserAccountID, participantsAccountIDs.at(0) ?? -1]);
const moneyRequestOptions = ReportUtils.temporary_getMoneyRequestOptions(report, paidPolicy, [
currentUserAccountID,
participantsAccountIDs.at(0) ?? CONST.DEFAULT_NUMBER_ID,
]);
expect(moneyRequestOptions.length).toBe(0);
});
});
Expand All @@ -558,7 +561,10 @@ describe('ReportUtils', () => {
...LHNTestUtils.getFakeReport(),
chatType,
};
const moneyRequestOptions = ReportUtils.temporary_getMoneyRequestOptions(report, undefined, [currentUserAccountID, participantsAccountIDs.at(0) ?? -1]);
const moneyRequestOptions = ReportUtils.temporary_getMoneyRequestOptions(report, undefined, [
currentUserAccountID,
participantsAccountIDs.at(0) ?? CONST.DEFAULT_NUMBER_ID,
]);
return moneyRequestOptions.length === 1 && moneyRequestOptions.includes(CONST.IOU.TYPE.SPLIT);
});
expect(onlyHaveSplitOption).toBe(true);
Expand Down Expand Up @@ -605,7 +611,7 @@ describe('ReportUtils', () => {
statusNum: CONST.REPORT.STATUS_NUM.SUBMITTED,
managerID: currentUserAccountID,
};
const moneyRequestOptions = ReportUtils.temporary_getMoneyRequestOptions(report, undefined, [currentUserAccountID, participantsAccountIDs.at(0) ?? -1]);
const moneyRequestOptions = ReportUtils.temporary_getMoneyRequestOptions(report, undefined, [currentUserAccountID, participantsAccountIDs.at(0) ?? CONST.DEFAULT_NUMBER_ID]);
expect(moneyRequestOptions.length).toBe(1);
expect(moneyRequestOptions.includes(CONST.IOU.TYPE.SUBMIT)).toBe(true);
});
Expand All @@ -618,7 +624,7 @@ describe('ReportUtils', () => {
statusNum: CONST.REPORT.STATUS_NUM.SUBMITTED,
managerID: currentUserAccountID,
};
const moneyRequestOptions = ReportUtils.temporary_getMoneyRequestOptions(report, undefined, [currentUserAccountID, participantsAccountIDs.at(0) ?? -1]);
const moneyRequestOptions = ReportUtils.temporary_getMoneyRequestOptions(report, undefined, [currentUserAccountID, participantsAccountIDs.at(0) ?? CONST.DEFAULT_NUMBER_ID]);
expect(moneyRequestOptions.length).toBe(1);
expect(moneyRequestOptions.includes(CONST.IOU.TYPE.SUBMIT)).toBe(true);
});
Expand Down Expand Up @@ -667,7 +673,10 @@ describe('ReportUtils', () => {
outputCurrency: '',
isPolicyExpenseChatEnabled: false,
} as const;
const moneyRequestOptions = ReportUtils.temporary_getMoneyRequestOptions(report, paidPolicy, [currentUserAccountID, participantsAccountIDs.at(0) ?? -1]);
const moneyRequestOptions = ReportUtils.temporary_getMoneyRequestOptions(report, paidPolicy, [
currentUserAccountID,
participantsAccountIDs.at(0) ?? CONST.DEFAULT_NUMBER_ID,
]);
expect(moneyRequestOptions.length).toBe(2);
expect(moneyRequestOptions.includes(CONST.IOU.TYPE.SUBMIT)).toBe(true);
expect(moneyRequestOptions.includes(CONST.IOU.TYPE.TRACK)).toBe(true);
Expand All @@ -682,7 +691,7 @@ describe('ReportUtils', () => {
statusNum: CONST.REPORT.STATUS_NUM.SUBMITTED,
managerID: currentUserAccountID,
};
const moneyRequestOptions = ReportUtils.temporary_getMoneyRequestOptions(report, undefined, [currentUserAccountID, participantsAccountIDs.at(0) ?? -1]);
const moneyRequestOptions = ReportUtils.temporary_getMoneyRequestOptions(report, undefined, [currentUserAccountID, participantsAccountIDs.at(0) ?? CONST.DEFAULT_NUMBER_ID]);
expect(moneyRequestOptions.length).toBe(1);
expect(moneyRequestOptions.includes(CONST.IOU.TYPE.SUBMIT)).toBe(true);
});
Expand All @@ -695,7 +704,7 @@ describe('ReportUtils', () => {
statusNum: CONST.REPORT.STATUS_NUM.SUBMITTED,
managerID: currentUserAccountID,
};
const moneyRequestOptions = ReportUtils.temporary_getMoneyRequestOptions(report, undefined, [currentUserAccountID, participantsAccountIDs.at(0) ?? -1]);
const moneyRequestOptions = ReportUtils.temporary_getMoneyRequestOptions(report, undefined, [currentUserAccountID, participantsAccountIDs.at(0) ?? CONST.DEFAULT_NUMBER_ID]);
expect(moneyRequestOptions.length).toBe(1);
expect(moneyRequestOptions.includes(CONST.IOU.TYPE.SUBMIT)).toBe(true);
});
Expand Down Expand Up @@ -738,7 +747,10 @@ describe('ReportUtils', () => {
managerID: currentUserAccountID,
ownerAccountID: currentUserAccountID,
};
const moneyRequestOptions = ReportUtils.temporary_getMoneyRequestOptions(report, paidPolicy, [currentUserAccountID, participantsAccountIDs.at(0) ?? -1]);
const moneyRequestOptions = ReportUtils.temporary_getMoneyRequestOptions(report, paidPolicy, [
currentUserAccountID,
participantsAccountIDs.at(0) ?? CONST.DEFAULT_NUMBER_ID,
]);
expect(moneyRequestOptions.length).toBe(2);
expect(moneyRequestOptions.includes(CONST.IOU.TYPE.SUBMIT)).toBe(true);
expect(moneyRequestOptions.includes(CONST.IOU.TYPE.TRACK)).toBe(true);
Expand All @@ -752,7 +764,7 @@ describe('ReportUtils', () => {
...LHNTestUtils.getFakeReport(),
type: CONST.REPORT.TYPE.CHAT,
};
const moneyRequestOptions = ReportUtils.temporary_getMoneyRequestOptions(report, undefined, [currentUserAccountID, participantsAccountIDs.at(0) ?? -1]);
const moneyRequestOptions = ReportUtils.temporary_getMoneyRequestOptions(report, undefined, [currentUserAccountID, participantsAccountIDs.at(0) ?? CONST.DEFAULT_NUMBER_ID]);
expect(moneyRequestOptions.length).toBe(3);
expect(moneyRequestOptions.includes(CONST.IOU.TYPE.SPLIT)).toBe(true);
expect(moneyRequestOptions.includes(CONST.IOU.TYPE.SUBMIT)).toBe(true);
Expand Down

0 comments on commit 7db6695

Please sign in to comment.