diff --git a/src/components/MoneyReportHeaderActions/MoneyReportHeaderSecondaryActions.tsx b/src/components/MoneyReportHeaderActions/MoneyReportHeaderSecondaryActions.tsx index 99917ac25fdb..241f74354f8e 100644 --- a/src/components/MoneyReportHeaderActions/MoneyReportHeaderSecondaryActions.tsx +++ b/src/components/MoneyReportHeaderActions/MoneyReportHeaderSecondaryActions.tsx @@ -109,6 +109,7 @@ function MoneyReportHeaderSecondaryActionsInner({reportID, primaryAction, isRepo const {isOffline} = useNetwork(); const activePolicy = usePolicy(activePolicyID); + const chatReportPolicy = usePolicy(chatReport?.policyID); const lastWorkspaceNumber = useLastWorkspaceNumber(); const {isBetaEnabled} = usePermissions(); @@ -185,6 +186,7 @@ function MoneyReportHeaderSecondaryActionsInner({reportID, primaryAction, isRepo currentUserLogin: currentUserLogin ?? '', activePolicy, policy, + chatReportPolicy, betas, isSelfTourViewed, userBillingGracePeriodEnds, diff --git a/src/components/MoneyReportHeaderActions/MoneyReportHeaderSelectionDropdown.tsx b/src/components/MoneyReportHeaderActions/MoneyReportHeaderSelectionDropdown.tsx index 4288d219e31e..f6604b27dcf7 100644 --- a/src/components/MoneyReportHeaderActions/MoneyReportHeaderSelectionDropdown.tsx +++ b/src/components/MoneyReportHeaderActions/MoneyReportHeaderSelectionDropdown.tsx @@ -111,6 +111,7 @@ function MoneyReportHeaderSelectionDropdown({reportID, primaryAction, isReportIn const [activePolicyID] = useOnyx(ONYXKEYS.NVP_ACTIVE_POLICY_ID); const [isSelfTourViewed = false] = useOnyx(ONYXKEYS.NVP_ONBOARDING, {selector: hasSeenTourSelector}); const activePolicy = usePolicy(activePolicyID); + const chatReportPolicy = usePolicy(chatReport?.policyID); const existingB2BInvoiceReport = useParticipantsInvoiceReport(activePolicyID, CONST.REPORT.INVOICE_RECEIVER_TYPE.BUSINESS, chatReport?.policyID); const isInvoiceReport = isInvoiceReportUtil(moneyRequestReport); @@ -267,6 +268,7 @@ function MoneyReportHeaderSelectionDropdown({reportID, primaryAction, isReportIn currentUserLogin: currentUserLogin ?? '', activePolicy, policy, + chatReportPolicy, betas, isSelfTourViewed, userBillingGracePeriodEnds, diff --git a/src/components/MoneyReportHeaderPrimaryAction/PayPrimaryAction.tsx b/src/components/MoneyReportHeaderPrimaryAction/PayPrimaryAction.tsx index 15d8408fd7c1..f85b2122978c 100644 --- a/src/components/MoneyReportHeaderPrimaryAction/PayPrimaryAction.tsx +++ b/src/components/MoneyReportHeaderPrimaryAction/PayPrimaryAction.tsx @@ -59,6 +59,7 @@ function PayPrimaryAction({reportID, chatReportID}: PayPrimaryActionProps) { const [reportMetadata] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT_METADATA}${moneyRequestReport?.reportID}`); const activePolicy = usePolicy(activePolicyID); + const chatReportPolicy = usePolicy(chatReport?.policyID); const invoiceReceiverPolicyID = chatReport?.invoiceReceiver && 'policyID' in chatReport.invoiceReceiver ? chatReport.invoiceReceiver.policyID : undefined; const [invoiceReceiverPolicy] = useOnyx(`${ONYXKEYS.COLLECTION.POLICY}${invoiceReceiverPolicyID}`); const existingB2BInvoiceReport = useParticipantsInvoiceReport(activePolicyID, CONST.REPORT.INVOICE_RECEIVER_TYPE.BUSINESS, chatReport?.policyID); @@ -131,6 +132,7 @@ function PayPrimaryAction({reportID, chatReportID}: PayPrimaryActionProps) { currentUserLogin: currentUserLogin ?? '', activePolicy, policy, + chatReportPolicy, betas, isSelfTourViewed, userBillingGracePeriodEnds, diff --git a/src/components/ReportActionItem/MoneyRequestReportPreview/PayActionButton.tsx b/src/components/ReportActionItem/MoneyRequestReportPreview/PayActionButton.tsx index ccb325d85031..a4cc1edea9f4 100644 --- a/src/components/ReportActionItem/MoneyRequestReportPreview/PayActionButton.tsx +++ b/src/components/ReportActionItem/MoneyRequestReportPreview/PayActionButton.tsx @@ -69,6 +69,7 @@ function PayActionButton({ const [iouReport] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT}${iouReportID}`); const [chatReport] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT}${chatReportID}`); const [policy] = useOnyx(`${ONYXKEYS.COLLECTION.POLICY}${iouReport?.policyID}`); + const chatReportPolicy = usePolicy(chatReport?.policyID); const [invoiceReceiverPolicy] = useOnyx( `${ONYXKEYS.COLLECTION.POLICY}${chatReport?.invoiceReceiver && 'policyID' in chatReport.invoiceReceiver ? chatReport.invoiceReceiver.policyID : undefined}`, ); @@ -167,6 +168,7 @@ function PayActionButton({ currentUserLogin: currentUserDetails.login ?? '', activePolicy, policy, + chatReportPolicy, betas, isSelfTourViewed, userBillingGracePeriodEnds, diff --git a/src/hooks/useHoldMenuSubmit.ts b/src/hooks/useHoldMenuSubmit.ts index 29920afd7a4b..f5082038cfdd 100644 --- a/src/hooks/useHoldMenuSubmit.ts +++ b/src/hooks/useHoldMenuSubmit.ts @@ -34,6 +34,7 @@ function useHoldMenuSubmit({moneyRequestReport, chatReport, requestType, payment const [ownerBillingGracePeriodEnd] = useOnyx(ONYXKEYS.NVP_PRIVATE_OWNER_BILLING_GRACE_PERIOD_END); const activePolicy = usePolicy(activePolicyID); const policy = usePolicy(moneyRequestReport?.policyID); + const chatReportPolicy = usePolicy(chatReport?.policyID); const [introSelected] = useOnyx(ONYXKEYS.NVP_INTRO_SELECTED); const [betas] = useOnyx(ONYXKEYS.BETAS); const [delegateEmail] = useOnyx(ONYXKEYS.ACCOUNT, {selector: delegateEmailSelector}); @@ -88,6 +89,7 @@ function useHoldMenuSubmit({moneyRequestReport, chatReport, requestType, payment full, activePolicy, policy, + chatReportPolicy, betas, isSelfTourViewed, userBillingGracePeriodEnds, diff --git a/src/hooks/useSelectionModeReportActions.ts b/src/hooks/useSelectionModeReportActions.ts index 49ac599c688b..d11ded0c0f17 100644 --- a/src/hooks/useSelectionModeReportActions.ts +++ b/src/hooks/useSelectionModeReportActions.ts @@ -114,6 +114,7 @@ function useSelectionModeReportActions({ const [activePolicyID] = useOnyx(ONYXKEYS.NVP_ACTIVE_POLICY_ID); const activePolicy = usePolicy(activePolicyID); + const chatReportPolicy = usePolicy(chatReport?.policyID); const [invoiceReceiverPolicy] = useOnyx( `${ONYXKEYS.COLLECTION.POLICY}${chatReport?.invoiceReceiver && 'policyID' in chatReport.invoiceReceiver ? chatReport.invoiceReceiver.policyID : undefined}`, ); @@ -387,6 +388,7 @@ function useSelectionModeReportActions({ currentUserLogin: currentUserLogin ?? '', activePolicy, policy, + chatReportPolicy, betas, isSelfTourViewed, userBillingGracePeriodEnds, diff --git a/src/libs/actions/IOU/PayMoneyRequest.ts b/src/libs/actions/IOU/PayMoneyRequest.ts index cba2df7d9e93..db52eba2b9c7 100644 --- a/src/libs/actions/IOU/PayMoneyRequest.ts +++ b/src/libs/actions/IOU/PayMoneyRequest.ts @@ -86,6 +86,7 @@ type PayMoneyRequestFunctionParams = { full?: boolean; activePolicy?: OnyxEntry; policy?: OnyxEntry; + chatReportPolicy: OnyxEntry; betas: OnyxEntry; isSelfTourViewed: boolean | undefined; amountOwed: OnyxEntry; @@ -739,6 +740,7 @@ function payMoneyRequest(params: PayMoneyRequestFunctionParams) { full = true, activePolicy, policy, + chatReportPolicy, betas, isSelfTourViewed, amountOwed, @@ -746,7 +748,12 @@ function payMoneyRequest(params: PayMoneyRequestFunctionParams) { methodID, onPaid, } = params; - if (chatReport.policyID && shouldRestrictUserBillableActions(chatReport.policyID, ownerBillingGracePeriodEnd, userBillingGracePeriodEnds, amountOwed)) { + const policyForBillingRestriction = chatReportPolicy ?? (policy?.id === chatReport.policyID ? policy : undefined); + if ( + chatReport.policyID && + policyForBillingRestriction && + shouldRestrictUserBillableActions(policyForBillingRestriction, ownerBillingGracePeriodEnd, userBillingGracePeriodEnds, amountOwed) + ) { Navigation.navigate(ROUTES.RESTRICTED_ACTION.getRoute(chatReport.policyID)); return; } diff --git a/tests/actions/IOUTest/PayMoneyRequestTest.ts b/tests/actions/IOUTest/PayMoneyRequestTest.ts index 2f17a201c44f..c8f61bc6c44f 100644 --- a/tests/actions/IOUTest/PayMoneyRequestTest.ts +++ b/tests/actions/IOUTest/PayMoneyRequestTest.ts @@ -32,6 +32,11 @@ import {getGlobalFetchMock, getOnyxData, translateLocal} from '../../utils/TestH import waitForBatchedUpdates from '../../utils/waitForBatchedUpdates'; const topMostReportID = '23423423'; + +function chatReportPolicyFromChat(chatReport: OnyxEntry): Policy { + return {...createRandomPolicy(0), id: chatReport?.policyID ?? CONST.POLICY.ID_FAKE}; +} + jest.mock('@src/libs/Navigation/Navigation', () => ({ navigate: jest.fn(), dismissModal: jest.fn(), @@ -231,21 +236,23 @@ describe('actions/IOU/PayMoneyRequest', () => { ) .then(() => { mockFetch?.pause?.(); - if (chatReport && iouReport) { - payMoneyRequest({ - paymentType: CONST.IOU.PAYMENT_TYPE.ELSEWHERE, - chatReport, - iouReport, - introSelected: undefined, - iouReportCurrentNextStepDeprecated: undefined, - currentUserAccountID, - currentUserLogin, - betas: [CONST.BETAS.ALL], - isSelfTourViewed: false, - userBillingGracePeriodEnds: undefined, - amountOwed: 0, - }); + if (!chatReport || !iouReport) { + return waitForBatchedUpdates(); } + payMoneyRequest({ + paymentType: CONST.IOU.PAYMENT_TYPE.ELSEWHERE, + chatReport, + iouReport, + introSelected: undefined, + iouReportCurrentNextStepDeprecated: undefined, + currentUserAccountID, + currentUserLogin, + betas: [CONST.BETAS.ALL], + isSelfTourViewed: false, + userBillingGracePeriodEnds: undefined, + amountOwed: 0, + chatReportPolicy: chatReportPolicyFromChat(chatReport), + }); return waitForBatchedUpdates(); }) .then( @@ -440,21 +447,23 @@ describe('actions/IOU/PayMoneyRequest', () => { }), ) .then(() => { - if (chatReport && expenseReport) { - payMoneyRequest({ - paymentType: CONST.IOU.PAYMENT_TYPE.VBBA, - chatReport, - iouReport: expenseReport, - introSelected: undefined, - iouReportCurrentNextStepDeprecated: undefined, - currentUserAccountID: CARLOS_ACCOUNT_ID, - currentUserLogin: CARLOS_EMAIL, - betas: [CONST.BETAS.ALL], - isSelfTourViewed: false, - userBillingGracePeriodEnds: undefined, - amountOwed: 0, - }); + if (!chatReport || !expenseReport) { + return waitForBatchedUpdates(); } + payMoneyRequest({ + paymentType: CONST.IOU.PAYMENT_TYPE.VBBA, + chatReport, + iouReport: expenseReport, + introSelected: undefined, + iouReportCurrentNextStepDeprecated: undefined, + currentUserAccountID: CARLOS_ACCOUNT_ID, + currentUserLogin: CARLOS_EMAIL, + betas: [CONST.BETAS.ALL], + isSelfTourViewed: false, + userBillingGracePeriodEnds: undefined, + amountOwed: 0, + chatReportPolicy: chatReportPolicyFromChat(chatReport), + }); return waitForBatchedUpdates(); }) .then( @@ -603,21 +612,23 @@ describe('actions/IOU/PayMoneyRequest', () => { ) .then(() => { mockFetch?.fail?.(); - if (chatReport && expenseReport) { - payMoneyRequest({ - paymentType: 'ACH', - chatReport, - iouReport: expenseReport, - introSelected: undefined, - iouReportCurrentNextStepDeprecated: undefined, - currentUserAccountID: CARLOS_ACCOUNT_ID, - currentUserLogin: CARLOS_EMAIL, - betas: [CONST.BETAS.ALL], - isSelfTourViewed: false, - userBillingGracePeriodEnds: undefined, - amountOwed: 0, - }); + if (!chatReport || !expenseReport) { + return waitForBatchedUpdates(); } + payMoneyRequest({ + paymentType: 'ACH', + chatReport, + iouReport: expenseReport, + introSelected: undefined, + iouReportCurrentNextStepDeprecated: undefined, + currentUserAccountID: CARLOS_ACCOUNT_ID, + currentUserLogin: CARLOS_EMAIL, + betas: [CONST.BETAS.ALL], + isSelfTourViewed: false, + userBillingGracePeriodEnds: undefined, + amountOwed: 0, + chatReportPolicy: chatReportPolicyFromChat(chatReport), + }); return waitForBatchedUpdates(); }) .then( @@ -657,6 +668,7 @@ describe('actions/IOU/PayMoneyRequest', () => { jest.advanceTimersByTime(10); // When paying the IOU report + const chatReportPolicy = chatReportPolicyFromChat(chatReport); payMoneyRequest({ paymentType: CONST.IOU.PAYMENT_TYPE.ELSEWHERE, chatReport, @@ -669,6 +681,7 @@ describe('actions/IOU/PayMoneyRequest', () => { isSelfTourViewed: false, userBillingGracePeriodEnds: undefined, amountOwed: 0, + chatReportPolicy, }); await waitForBatchedUpdates(); @@ -771,9 +784,10 @@ describe('actions/IOU/PayMoneyRequest', () => { }) .then(() => { // When partially paying an iou report from the chat report via the report preview + const partialPayChatReport = {reportID: topMostReportID, policyID: CONST.POLICY.ID_FAKE}; payMoneyRequest({ paymentType: CONST.IOU.PAYMENT_TYPE.ELSEWHERE, - chatReport: {reportID: topMostReportID}, + chatReport: partialPayChatReport, iouReport, introSelected: undefined, iouReportCurrentNextStepDeprecated: undefined, @@ -784,6 +798,7 @@ describe('actions/IOU/PayMoneyRequest', () => { isSelfTourViewed: false, userBillingGracePeriodEnds: undefined, amountOwed: 0, + chatReportPolicy: chatReportPolicyFromChat(partialPayChatReport), }); return waitForBatchedUpdates(); }) @@ -876,6 +891,7 @@ describe('actions/IOU/PayMoneyRequest', () => { currentUserLogin: CARLOS_EMAIL, full: false, policy, + chatReportPolicy: policy, betas: [CONST.BETAS.ALL], isSelfTourViewed: false, userBillingGracePeriodEnds: undefined, @@ -903,6 +919,7 @@ describe('actions/IOU/PayMoneyRequest', () => { jest.advanceTimersByTime(10); + const chatReportPolicyTrueTour = chatReportPolicyFromChat(chatReport); payMoneyRequest({ paymentType: CONST.IOU.PAYMENT_TYPE.ELSEWHERE, chatReport, @@ -915,6 +932,7 @@ describe('actions/IOU/PayMoneyRequest', () => { isSelfTourViewed: true, userBillingGracePeriodEnds: undefined, amountOwed: 0, + chatReportPolicy: chatReportPolicyTrueTour, }); await waitForBatchedUpdates(); @@ -951,6 +969,7 @@ describe('actions/IOU/PayMoneyRequest', () => { jest.advanceTimersByTime(10); + const chatReportPolicyFalseTour = chatReportPolicyFromChat(chatReport); payMoneyRequest({ paymentType: CONST.IOU.PAYMENT_TYPE.ELSEWHERE, chatReport, @@ -963,6 +982,7 @@ describe('actions/IOU/PayMoneyRequest', () => { isSelfTourViewed: false, userBillingGracePeriodEnds: undefined, amountOwed: 0, + chatReportPolicy: chatReportPolicyFalseTour, }); await waitForBatchedUpdates(); @@ -1032,6 +1052,8 @@ describe('actions/IOU/PayMoneyRequest', () => { userBillingGracePeriodEnds: undefined, amountOwed: 100, ownerBillingGracePeriodEnd: pastDate, + policy, + chatReportPolicy: policy, }); await waitForBatchedUpdates(); @@ -1039,6 +1061,128 @@ describe('actions/IOU/PayMoneyRequest', () => { expect(Navigation.navigate).toHaveBeenCalledWith(ROUTES.RESTRICTED_ACTION.getRoute(policyID)); }); + it('should navigate to restricted using chatReportPolicy when IOU policy id differs from chat workspace policy id', async () => { + const workspacePolicyID = generatePolicyID(); + const expensePolicyID = generatePolicyID(); + + await Onyx.set(ONYXKEYS.SESSION, {email: CARLOS_EMAIL, accountID: CARLOS_ACCOUNT_ID}); + + const workspacePolicy = { + ...createRandomPolicy(9001), + id: workspacePolicyID, + ownerAccountID: CARLOS_ACCOUNT_ID, + role: CONST.POLICY.ROLE.ADMIN, + }; + const expensePolicy = { + ...createRandomPolicy(9002), + id: expensePolicyID, + ownerAccountID: 999, + role: CONST.POLICY.ROLE.ADMIN, + }; + + await Onyx.set(`${ONYXKEYS.COLLECTION.POLICY}${workspacePolicyID}`, workspacePolicy); + await Onyx.set(`${ONYXKEYS.COLLECTION.POLICY}${expensePolicyID}`, expensePolicy); + + const pastDate = Math.floor(Date.now() / 1000) - 86400 * 30; + await Onyx.set(ONYXKEYS.NVP_PRIVATE_OWNER_BILLING_GRACE_PERIOD_END, pastDate); + await Onyx.set(ONYXKEYS.NVP_PRIVATE_AMOUNT_OWED, 100); + + const chatReport = { + ...createRandomReport(0, undefined), + policyID: workspacePolicyID, + type: CONST.REPORT.TYPE.CHAT, + chatType: CONST.REPORT.CHAT_TYPE.POLICY_EXPENSE_CHAT, + }; + const iouReport = { + ...createRandomReport(1, undefined), + type: CONST.REPORT.TYPE.IOU, + total: 10, + policyID: expensePolicyID, + }; + + await Onyx.set(`${ONYXKEYS.COLLECTION.REPORT}${chatReport.reportID}`, chatReport); + await Onyx.set(`${ONYXKEYS.COLLECTION.REPORT}${iouReport.reportID}`, iouReport); + + (Navigation.navigate as jest.Mock).mockClear(); + + payMoneyRequest({ + paymentType: CONST.IOU.PAYMENT_TYPE.ELSEWHERE, + chatReport, + iouReport, + introSelected: undefined, + iouReportCurrentNextStepDeprecated: undefined, + currentUserAccountID: CARLOS_ACCOUNT_ID, + currentUserLogin: CARLOS_EMAIL, + betas: [CONST.BETAS.ALL], + isSelfTourViewed: false, + userBillingGracePeriodEnds: undefined, + amountOwed: 100, + ownerBillingGracePeriodEnd: pastDate, + policy: expensePolicy, + chatReportPolicy: workspacePolicy, + }); + + await waitForBatchedUpdates(); + + expect(Navigation.navigate).toHaveBeenCalledWith(ROUTES.RESTRICTED_ACTION.getRoute(workspacePolicyID)); + }); + + it('should not navigate to restricted when chatReportPolicy passes billing check with future owner grace period', async () => { + const policyID = generatePolicyID(); + + await Onyx.set(ONYXKEYS.SESSION, {email: CARLOS_EMAIL, accountID: CARLOS_ACCOUNT_ID}); + const workspacePolicy = { + ...createRandomPolicy(9003), + id: policyID, + ownerAccountID: CARLOS_ACCOUNT_ID, + role: CONST.POLICY.ROLE.ADMIN, + }; + await Onyx.set(`${ONYXKEYS.COLLECTION.POLICY}${policyID}`, workspacePolicy); + + const futureGraceEnd = Math.floor(Date.now() / 1000) + 86400 * 30; + await Onyx.set(ONYXKEYS.NVP_PRIVATE_OWNER_BILLING_GRACE_PERIOD_END, futureGraceEnd); + await Onyx.set(ONYXKEYS.NVP_PRIVATE_AMOUNT_OWED, 100); + + const chatReport = { + ...createRandomReport(0, undefined), + policyID, + type: CONST.REPORT.TYPE.CHAT, + chatType: CONST.REPORT.CHAT_TYPE.POLICY_EXPENSE_CHAT, + }; + const iouReport = { + ...createRandomReport(1, undefined), + type: CONST.REPORT.TYPE.IOU, + total: 10, + policyID, + }; + + await Onyx.set(`${ONYXKEYS.COLLECTION.REPORT}${chatReport.reportID}`, chatReport); + await Onyx.set(`${ONYXKEYS.COLLECTION.REPORT}${iouReport.reportID}`, iouReport); + + (Navigation.navigate as jest.Mock).mockClear(); + + payMoneyRequest({ + paymentType: CONST.IOU.PAYMENT_TYPE.ELSEWHERE, + chatReport, + iouReport, + introSelected: undefined, + iouReportCurrentNextStepDeprecated: undefined, + currentUserAccountID: CARLOS_ACCOUNT_ID, + currentUserLogin: CARLOS_EMAIL, + betas: [CONST.BETAS.ALL], + isSelfTourViewed: false, + userBillingGracePeriodEnds: undefined, + amountOwed: 100, + ownerBillingGracePeriodEnd: futureGraceEnd, + chatReportPolicy: workspacePolicy, + policy: workspacePolicy, + }); + + await waitForBatchedUpdates(); + + expect(Navigation.navigate).not.toHaveBeenCalledWith(ROUTES.RESTRICTED_ACTION.getRoute(policyID)); + }); + it('should pay successfully when amountOwed is 0', async () => { const chatReport = { ...createRandomReport(0, undefined), @@ -1054,6 +1198,7 @@ describe('actions/IOU/PayMoneyRequest', () => { mockFetch?.pause?.(); jest.advanceTimersByTime(10); + const chatReportPolicyAmountZero = chatReportPolicyFromChat(chatReport); payMoneyRequest({ paymentType: CONST.IOU.PAYMENT_TYPE.ELSEWHERE, chatReport, @@ -1066,6 +1211,7 @@ describe('actions/IOU/PayMoneyRequest', () => { isSelfTourViewed: false, userBillingGracePeriodEnds: undefined, amountOwed: 0, + chatReportPolicy: chatReportPolicyAmountZero, }); await waitForBatchedUpdates(); @@ -1173,21 +1319,23 @@ describe('actions/IOU/PayMoneyRequest', () => { ) .then(() => { // When the expense report is paid elsewhere (but really, any payment option would work) - if (chatReport && expenseReport) { - payMoneyRequest({ - paymentType: CONST.IOU.PAYMENT_TYPE.ELSEWHERE, - chatReport, - iouReport: expenseReport, - introSelected: undefined, - iouReportCurrentNextStepDeprecated: undefined, - currentUserAccountID: CARLOS_ACCOUNT_ID, - currentUserLogin: CARLOS_EMAIL, - betas: [CONST.BETAS.ALL], - isSelfTourViewed: false, - userBillingGracePeriodEnds: undefined, - amountOwed: 0, - }); + if (!chatReport || !expenseReport) { + return waitForBatchedUpdates(); } + payMoneyRequest({ + paymentType: CONST.IOU.PAYMENT_TYPE.ELSEWHERE, + chatReport, + iouReport: expenseReport, + introSelected: undefined, + iouReportCurrentNextStepDeprecated: undefined, + currentUserAccountID: CARLOS_ACCOUNT_ID, + currentUserLogin: CARLOS_EMAIL, + betas: [CONST.BETAS.ALL], + isSelfTourViewed: false, + userBillingGracePeriodEnds: undefined, + amountOwed: 0, + chatReportPolicy: chatReportPolicyFromChat(chatReport), + }); return waitForBatchedUpdates(); }) .then(() => { @@ -1410,6 +1558,7 @@ describe('actions/IOU/PayMoneyRequest', () => { isSelfTourViewed: false, userBillingGracePeriodEnds: undefined, amountOwed: 0, + chatReportPolicy: chatReportPolicyFromChat(chatReport), }); } await waitForBatchedUpdates();