diff --git a/src/libs/NextStepUtils.ts b/src/libs/NextStepUtils.ts index db31ab02a3e5..8da35232112d 100644 --- a/src/libs/NextStepUtils.ts +++ b/src/libs/NextStepUtils.ts @@ -51,7 +51,7 @@ function parseMessage(messages: Message[] | undefined) { } type BuildNextStepParameters = { - isPaidWithWallet?: boolean; + isPaidWithExpensify?: boolean; }; /** @@ -59,10 +59,14 @@ type BuildNextStepParameters = { * * @param report * @param predictedNextStatus - a next expected status of the report - * @param parameters.isPaidWithWallet - Whether a report has been paid with the wallet or outside of Expensify + * @param parameters.isPaidWithExpensify - Whether a report has been paid with Expensify or outside * @returns nextStep */ -function buildNextStep(report: Report | EmptyObject, predictedNextStatus: ValueOf, {isPaidWithWallet}: BuildNextStepParameters = {}): ReportNextStep | null { +function buildNextStep( + report: Report | EmptyObject, + predictedNextStatus: ValueOf, + {isPaidWithExpensify}: BuildNextStepParameters = {}, +): ReportNextStep | null { if (!ReportUtils.isExpenseReport(report)) { return null; } @@ -317,7 +321,7 @@ function buildNextStep(report: Report | EmptyObject, predictedNextStatus: ValueO }; // Paid outside of Expensify - if (isPaidWithWallet === false) { + if (isPaidWithExpensify === false) { optimisticNextStep.message?.push({text: ' outside of Expensify'}); } diff --git a/src/libs/actions/IOU.ts b/src/libs/actions/IOU.ts index 94f08e5a682c..fbc124735db3 100644 --- a/src/libs/actions/IOU.ts +++ b/src/libs/actions/IOU.ts @@ -3314,7 +3314,7 @@ function getPayMoneyRequestParams(chatReport: OnyxTypes.Report, iouReport: OnyxT } const currentNextStep = allNextSteps[`${ONYXKEYS.COLLECTION.NEXT_STEP}${iouReport.reportID}`] ?? null; - const optimisticNextStep = NextStepUtils.buildNextStep(iouReport, CONST.REPORT.STATUS_NUM.REIMBURSED, {isPaidWithWallet: paymentMethodType === CONST.IOU.PAYMENT_TYPE.EXPENSIFY}); + const optimisticNextStep = NextStepUtils.buildNextStep(iouReport, CONST.REPORT.STATUS_NUM.REIMBURSED, {isPaidWithExpensify: paymentMethodType === CONST.IOU.PAYMENT_TYPE.VBBA}); const optimisticData: OnyxUpdate[] = [ { diff --git a/tests/unit/NextStepUtilsTest.ts b/tests/unit/NextStepUtilsTest.ts index 5f4b1a6ed96b..6cf8b37aadab 100644 --- a/tests/unit/NextStepUtilsTest.ts +++ b/tests/unit/NextStepUtilsTest.ts @@ -519,7 +519,7 @@ describe('libs/NextStepUtils', () => { }, ]; - const result = NextStepUtils.buildNextStep(report, CONST.REPORT.STATUS_NUM.REIMBURSED, {isPaidWithWallet: true}); + const result = NextStepUtils.buildNextStep(report, CONST.REPORT.STATUS_NUM.REIMBURSED, {isPaidWithExpensify: true}); expect(result).toMatchObject(optimisticNextStep); }); @@ -546,7 +546,7 @@ describe('libs/NextStepUtils', () => { }, ]; - const result = NextStepUtils.buildNextStep(report, CONST.REPORT.STATUS_NUM.REIMBURSED, {isPaidWithWallet: false}); + const result = NextStepUtils.buildNextStep(report, CONST.REPORT.STATUS_NUM.REIMBURSED, {isPaidWithExpensify: false}); expect(result).toMatchObject(optimisticNextStep); });