From cd7bf506b6d1055c31bad26b95ffa5c88162ae85 Mon Sep 17 00:00:00 2001 From: Brendan Hy Date: Wed, 26 Nov 2025 12:20:55 -0800 Subject: [PATCH 1/2] fix(billing): Check self serve partner value in hasBillingInfo --- .../gsApp/views/amCheckout/components/cart.spec.tsx | 5 ++++- static/gsApp/views/amCheckout/utils.tsx | 11 +++++++++-- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/static/gsApp/views/amCheckout/components/cart.spec.tsx b/static/gsApp/views/amCheckout/components/cart.spec.tsx index b7272d02c691fd..a1f0512e7261ca 100644 --- a/static/gsApp/views/amCheckout/components/cart.spec.tsx +++ b/static/gsApp/views/amCheckout/components/cart.spec.tsx @@ -457,6 +457,7 @@ describe('Cart', () => { }, name: 'partner', }, + paymentSource: null, }); render( @@ -471,7 +472,9 @@ describe('Cart', () => { ); // wait for preview to be loaded - await screen.findByRole('button', {name: 'Confirm and pay'}); + await waitFor(() => + expect(screen.getByRole('button', {name: 'Confirm and pay'})).toBeEnabled() + ); screen.getByText(/you will be billed by Partner/); }); diff --git a/static/gsApp/views/amCheckout/utils.tsx b/static/gsApp/views/amCheckout/utils.tsx index 601742574f05cc..cd785f6a54ba5f 100644 --- a/static/gsApp/views/amCheckout/utils.tsx +++ b/static/gsApp/views/amCheckout/utils.tsx @@ -900,9 +900,16 @@ export function hasBillingInfo( isComplete: boolean ) { if (isComplete) { - return !!subscription.paymentSource && hasSomeBillingDetails(billingDetails); + return ( + subscription.isSelfServePartner || + (!!subscription.paymentSource && hasSomeBillingDetails(billingDetails)) + ); } - return !!subscription.paymentSource || hasSomeBillingDetails(billingDetails); + return ( + subscription.isSelfServePartner || + !!subscription.paymentSource || + hasSomeBillingDetails(billingDetails) + ); } /** From e85833cdbb003b97f4636a75b4f822ccad41a370 Mon Sep 17 00:00:00 2001 From: Brendan Hy Date: Wed, 26 Nov 2025 12:24:09 -0800 Subject: [PATCH 2/2] reorder conditions --- static/gsApp/views/amCheckout/utils.tsx | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/static/gsApp/views/amCheckout/utils.tsx b/static/gsApp/views/amCheckout/utils.tsx index cd785f6a54ba5f..ff1a900877660e 100644 --- a/static/gsApp/views/amCheckout/utils.tsx +++ b/static/gsApp/views/amCheckout/utils.tsx @@ -899,17 +899,14 @@ export function hasBillingInfo( subscription: Subscription, isComplete: boolean ) { + if (subscription.isSelfServePartner) { + return true; + } + if (isComplete) { - return ( - subscription.isSelfServePartner || - (!!subscription.paymentSource && hasSomeBillingDetails(billingDetails)) - ); + return !!subscription.paymentSource && hasSomeBillingDetails(billingDetails); } - return ( - subscription.isSelfServePartner || - !!subscription.paymentSource || - hasSomeBillingDetails(billingDetails) - ); + return !!subscription.paymentSource || hasSomeBillingDetails(billingDetails); } /**