Skip to content

Commit

Permalink
remove unused policy param
Browse files Browse the repository at this point in the history
  • Loading branch information
roryabraham committed Apr 3, 2024
1 parent 2252a6c commit e6a3ccb
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/libs/actions/IOU.ts
Original file line number Diff line number Diff line change
Expand Up @@ -462,7 +462,7 @@ function needsToBeManuallySubmitted(report: OnyxTypes.Report) {
/**
* Return the object to update hasOutstandingChildRequest
*/
function hasOutstandingChildRequest(report: OnyxTypes.Report, policy: OnyxEntry<OnyxTypes.Policy> | EmptyObject): boolean {
function hasOutstandingChildRequest(report: OnyxTypes.Report): boolean {
if (needsToBeManuallySubmitted(report)) {
return true;
}
Expand Down Expand Up @@ -510,7 +510,7 @@ function buildOnyxDataForMoneyRequest(
lastReadTime: DateUtils.getDBTime(),
lastMessageTranslationKey: '',
iouReportID: iouReport.reportID,
hasOutstandingChildRequest: hasOutstandingChildRequest(iouReport, policy ?? {}),
hasOutstandingChildRequest: hasOutstandingChildRequest(iouReport),
...(isNewChatReport ? {pendingFields: {createChat: CONST.RED_BRICK_ROAD_PENDING_ACTION.ADD}} : {}),
},
});
Expand Down
10 changes: 5 additions & 5 deletions tests/actions/IOUTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3308,7 +3308,7 @@ describe('actions/IOU', () => {
policyID: policy.id,
};
await Onyx.set(`${ONYXKEYS.COLLECTION.POLICY}${policy.id}`, policy);
expect(IOU.hasOutstandingChildRequest(report, policy)).toBe(true);
expect(IOU.hasOutstandingChildRequest(report)).toBe(true);
});
it('should return false if an expense report does not need to be manually submitted', async () => {
const policy = {
Expand All @@ -3321,7 +3321,7 @@ describe('actions/IOU', () => {
policyID: policy.id,
};
await Onyx.set(`${ONYXKEYS.COLLECTION.POLICY}${policy.id}`, policy);
expect(IOU.hasOutstandingChildRequest(report, policy)).toBe(false);
expect(IOU.hasOutstandingChildRequest(report)).toBe(false);
});
it('should return false for an IOU report where no money is owed', async () => {
const report = {
Expand All @@ -3334,7 +3334,7 @@ describe('actions/IOU', () => {
email: RORY_EMAIL,
accountID: RORY_ACCOUNT_ID,
});
expect(IOU.hasOutstandingChildRequest(report, {})).toBe(false);
expect(IOU.hasOutstandingChildRequest(report)).toBe(false);
});
it('should return true for an IOU report where money is owed and the current user is the manager', async () => {
const report = {
Expand All @@ -3347,7 +3347,7 @@ describe('actions/IOU', () => {
email: RORY_EMAIL,
accountID: RORY_ACCOUNT_ID,
});
expect(IOU.hasOutstandingChildRequest(report, {})).toBe(true);
expect(IOU.hasOutstandingChildRequest(report)).toBe(true);
});
it('should return false for an IOU report where money is owed but the current user is not the manager', async () => {
const report = {
Expand All @@ -3359,7 +3359,7 @@ describe('actions/IOU', () => {
email: RORY_EMAIL,
accountID: RORY_ACCOUNT_ID,
});
expect(IOU.hasOutstandingChildRequest(report, {})).toBe(false);
expect(IOU.hasOutstandingChildRequest(report)).toBe(false);
});
});
});

0 comments on commit e6a3ccb

Please sign in to comment.