From db668f833c41e7c11f3b321e0b75d1df1dee0b2f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marco=20Ch=C3=A1vez=20=28via=20MelvinBot=29?= Date: Mon, 20 Jul 2026 20:45:47 +0000 Subject: [PATCH] Fix: keep Mark as paid label and action in sync after selecting Pay with business account MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Marco Chávez --- src/libs/SettlementButtonUtils.ts | 1 + tests/unit/SettlementButtonUtilsTest.ts | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/libs/SettlementButtonUtils.ts b/src/libs/SettlementButtonUtils.ts index 27b3ef2f4f16..2bb122114d86 100644 --- a/src/libs/SettlementButtonUtils.ts +++ b/src/libs/SettlementButtonUtils.ts @@ -24,6 +24,7 @@ const useSettlementButtonPaymentMethods = (hasActivatedWallet: boolean, translat text: translate('iou.settleBusiness', ''), icon: icons.Building, value: CONST.PAYMENT_METHODS.BUSINESS_BANK_ACCOUNT, + shouldUpdateSelectedIndex: false, key: CONST.PAYMENT_METHODS.BUSINESS_BANK_ACCOUNT, }, [CONST.IOU.PAYMENT_TYPE.ELSEWHERE]: { diff --git a/tests/unit/SettlementButtonUtilsTest.ts b/tests/unit/SettlementButtonUtilsTest.ts index 9cdc7f3851ad..c7a43a86b8ed 100644 --- a/tests/unit/SettlementButtonUtilsTest.ts +++ b/tests/unit/SettlementButtonUtilsTest.ts @@ -50,6 +50,7 @@ describe('useSettlementButtonPaymentMethods', () => { text: translate('iou.settleBusiness', ''), icon: icons.current.Building, value: CONST.PAYMENT_METHODS.BUSINESS_BANK_ACCOUNT, + shouldUpdateSelectedIndex: false, key: CONST.PAYMENT_METHODS.BUSINESS_BANK_ACCOUNT, }); }); @@ -116,10 +117,10 @@ describe('useSettlementButtonPaymentMethods', () => { } }); - it('should only set shouldUpdateSelectedIndex for elsewhere payment type', () => { + it('should set shouldUpdateSelectedIndex to false for business bank account and elsewhere payment types', () => { const {result} = renderHook(() => useSettlementButtonPaymentMethods(true, translate)); expect(result.current[CONST.PAYMENT_METHODS.PERSONAL_BANK_ACCOUNT]).not.toHaveProperty('shouldUpdateSelectedIndex'); - expect(result.current[CONST.PAYMENT_METHODS.BUSINESS_BANK_ACCOUNT]).not.toHaveProperty('shouldUpdateSelectedIndex'); + expect(result.current[CONST.PAYMENT_METHODS.BUSINESS_BANK_ACCOUNT].shouldUpdateSelectedIndex).toBe(false); expect(result.current[CONST.IOU.PAYMENT_TYPE.ELSEWHERE].shouldUpdateSelectedIndex).toBe(false); }); });