From 7b49f269bf32495457c28c41b75efdb88ab8314a Mon Sep 17 00:00:00 2001 From: Wildan Muhlis Date: Wed, 13 May 2026 09:59:15 +0700 Subject: [PATCH 1/2] Skip account validation for bulk Mark as paid (ELSEWHERE) --- src/libs/actions/Search.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libs/actions/Search.ts b/src/libs/actions/Search.ts index 20059d76789c..17ee086c2887 100644 --- a/src/libs/actions/Search.ts +++ b/src/libs/actions/Search.ts @@ -1421,7 +1421,7 @@ function handleBulkPayItemSelected(params: { return; } - if (!isUserValidated) { + if (!isUserValidated && item.key !== CONST.IOU.PAYMENT_TYPE.ELSEWHERE) { Navigation.navigate(ROUTES.SETTINGS_CONTACT_METHOD_VERIFY_ACCOUNT.getRoute(Navigation.getActiveRoute())); return; } From 9f354bb0bf5e1e134b3a23e89ba4ac1aa828324e Mon Sep 17 00:00:00 2001 From: Wildan Muhlis Date: Tue, 19 May 2026 13:05:33 +0700 Subject: [PATCH 2/2] Add unit tests for handleBulkPayItemSelected isUserValidated branch --- .../Search/handleActionButtonPressTest.ts | 42 +++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/tests/unit/Search/handleActionButtonPressTest.ts b/tests/unit/Search/handleActionButtonPressTest.ts index b32202b5b2a6..2c7bc4b8ee95 100644 --- a/tests/unit/Search/handleActionButtonPressTest.ts +++ b/tests/unit/Search/handleActionButtonPressTest.ts @@ -498,4 +498,46 @@ describe('handleBulkPayItemSelected', () => { expect(baseParams.confirmPayment).toHaveBeenCalled(); }); + + it('should not navigate to verify account and should call confirmPayment when user is unvalidated and item is Mark as paid (ELSEWHERE)', async () => { + const policy = { + ...createRandomPolicy(Number(policyID)), + id: policyID, + ownerAccountID, + } as Policy; + + await Onyx.set(`${ONYXKEYS.COLLECTION.POLICY}${policyID}`, policy); + + handleBulkPayItemSelected({ + ...baseParams, + policy, + amountOwed: 0, + isUserValidated: false, + item: {key: CONST.IOU.PAYMENT_TYPE.ELSEWHERE, text: 'Pay elsewhere', icon: () => null}, + }); + + expect(Navigation.navigate).not.toHaveBeenCalledWith(ROUTES.SETTINGS_CONTACT_METHOD_VERIFY_ACCOUNT.getRoute(Navigation.getActiveRoute())); + expect(baseParams.confirmPayment).toHaveBeenCalled(); + }); + + it('should navigate to verify account when user is unvalidated and item is a bank-funded payment type (VBBA)', async () => { + const policy = { + ...createRandomPolicy(Number(policyID)), + id: policyID, + ownerAccountID, + } as Policy; + + await Onyx.set(`${ONYXKEYS.COLLECTION.POLICY}${policyID}`, policy); + + handleBulkPayItemSelected({ + ...baseParams, + policy, + amountOwed: 0, + isUserValidated: false, + item: {key: CONST.IOU.PAYMENT_TYPE.VBBA, text: 'Pay with bank account', icon: () => null}, + }); + + expect(Navigation.navigate).toHaveBeenCalledWith(ROUTES.SETTINGS_CONTACT_METHOD_VERIFY_ACCOUNT.getRoute(Navigation.getActiveRoute())); + expect(baseParams.confirmPayment).not.toHaveBeenCalled(); + }); });