Skip to content

Commit 96e56ff

Browse files
committed
fix: typecheck
1 parent 38362cd commit 96e56ff

2 files changed

Lines changed: 4 additions & 1 deletion

File tree

src/pages/iou/request/step/BaseRequestStepWorkspace.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ function BaseRequestStepWorkspace({transaction, getPolicies, onSelectWorkspace}:
8282
const selectWorkspace = (item: WorkspaceListItem) => {
8383
const policyID = item.policyID;
8484
const policy = allPolicies?.[`${ONYXKEYS.COLLECTION.POLICY}${policyID}`];
85-
if (shouldRestrictUserBillableActions(policy ?? policyID, ownerBillingGracePeriodEnd, userBillingGracePeriodEnds, amountOwed, currentUserAccountID)) {
85+
if (shouldRestrictUserBillableActions(policy, ownerBillingGracePeriodEnd, userBillingGracePeriodEnds, amountOwed, currentUserAccountID)) {
8686
Navigation.navigate(ROUTES.RESTRICTED_ACTION.getRoute(policyID));
8787
return;
8888
}

tests/unit/Search/handleActionButtonPressTest.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -328,6 +328,7 @@ describe('handleActionButtonPress', () => {
328328
amountOwed: undefined,
329329
userBillingGracePeriodEnds: undefined,
330330
onHoldMenuOpen: jest.fn(),
331+
policy: snapshotPolicy as Policy,
331332
});
332333
expect(goToItem).not.toHaveBeenCalled();
333334
});
@@ -346,6 +347,7 @@ describe('handleActionButtonPress', () => {
346347
ownerBillingGracePeriodEnd: undefined,
347348
amountOwed: undefined,
348349
onHoldMenuOpen,
350+
policy: snapshotPolicy as Policy,
349351
});
350352

351353
expect(onHoldMenuOpen).toHaveBeenCalledWith(mockReportItemWithHold, CONST.IOU.REPORT_ACTION_TYPE.APPROVE);
@@ -364,6 +366,7 @@ describe('handleActionButtonPress', () => {
364366
ownerBillingGracePeriodEnd: undefined,
365367
amountOwed: undefined,
366368
userBillingGracePeriodEnds: undefined,
369+
policy: snapshotPolicy as Policy,
367370
});
368371
expect(goToItem).toHaveBeenCalledTimes(0);
369372
});

0 commit comments

Comments
 (0)