diff --git a/browser_tests/tests/billing/localWebBillingHandoff.spec.ts b/browser_tests/tests/billing/localWebBillingHandoff.spec.ts index f40d40ff24b..eb035f5b717 100644 --- a/browser_tests/tests/billing/localWebBillingHandoff.spec.ts +++ b/browser_tests/tests/billing/localWebBillingHandoff.spec.ts @@ -92,7 +92,7 @@ test.describe('Local web billing handoff', () => { await expect(page.getByRole('dialog')).toHaveCount(0) }) - test('shows the Billing tab in Settings instead of Plan & Credits', async ({ + test('shows the Billing tab without Platform links instead of Plan & Credits', async ({ comfyPage, cloudFlagReads }) => { @@ -102,7 +102,15 @@ test.describe('Local web billing handoff', () => { ) await settings.category('Billing', { exact: true }).click() - await expect(comfyPage.page.getByTestId('billing-tab')).toBeVisible() + const billingTab = comfyPage.page.getByTestId('billing-tab') + await expect(billingTab).toBeVisible() + await expect(billingTab.getByTestId('billing-handoff')).toHaveCount(0) + await expect(billingTab.locator('a[href*="/profile/"]')).toHaveCount(0) + await expect( + billingTab + .getByTestId('billing-plan-section') + .getByRole('button', { name: /plan/i }) + ).toHaveCount(0) await expect( settings.category('Plan & Credits', { exact: true }) ).toHaveCount(0) diff --git a/packages/account-ui/src/billing/tab/BillingAutoTopUpCard.test.ts b/packages/account-ui/src/billing/tab/BillingAutoTopUpCard.test.ts index 14177028302..a6c93c31623 100644 --- a/packages/account-ui/src/billing/tab/BillingAutoTopUpCard.test.ts +++ b/packages/account-ui/src/billing/tab/BillingAutoTopUpCard.test.ts @@ -285,6 +285,24 @@ describe('BillingAutoTopUpCard', () => { ) }) + it('keeps the status but no action when the host hides it', () => { + render(BillingAutoTopUpCard, { + props: { + state: loaded({ status: 'failed' }), + offView: 'off', + setup: null, + copy: autoTopUpCardCopy, + locale: 'en', + actionHref: 'https://billing.test/profile/billing', + actionHidden: true + } + }) + + expect(screen.getByTestId('billing-auto-top-up-status')).toBeTruthy() + expect(screen.queryByRole('link')).toBeNull() + expect(screen.queryByRole('button')).toBeNull() + }) + it('opens the host link in a new tab and reports the action', async () => { const onAction = vi.fn() render(BillingAutoTopUpCard, { diff --git a/packages/account-ui/src/billing/tab/BillingAutoTopUpCard.vue b/packages/account-ui/src/billing/tab/BillingAutoTopUpCard.vue index dccaeb6cf3b..8c8d4a1b32e 100644 --- a/packages/account-ui/src/billing/tab/BillingAutoTopUpCard.vue +++ b/packages/account-ui/src/billing/tab/BillingAutoTopUpCard.vue @@ -68,22 +68,13 @@ {{ copy.status[view.status] }} -

- {{ line.text }} - -

+ > classes?: Partial< Record< diff --git a/packages/account-ui/src/billing/tab/BillingAutoTopUpLines.vue b/packages/account-ui/src/billing/tab/BillingAutoTopUpLines.vue new file mode 100644 index 00000000000..70cbd9e2a9e --- /dev/null +++ b/packages/account-ui/src/billing/tab/BillingAutoTopUpLines.vue @@ -0,0 +1,25 @@ + + + diff --git a/packages/account-ui/src/billing/tab/billingBannerView.ts b/packages/account-ui/src/billing/tab/billingBannerView.ts index f7151edc526..f17219ac0bc 100644 --- a/packages/account-ui/src/billing/tab/billingBannerView.ts +++ b/packages/account-ui/src/billing/tab/billingBannerView.ts @@ -50,8 +50,8 @@ export type BillingBannerView = BillingBannerText & } | { readonly kind: 'autoTopUp' - readonly action: 'updatePayment' - readonly href: string + readonly action: 'updatePayment' | null + readonly href: string | null } | { readonly kind: 'credit' diff --git a/src/__mocks__/i18n.ts b/src/__mocks__/i18n.ts index f28355c8434..4dd385eb0d2 100644 --- a/src/__mocks__/i18n.ts +++ b/src/__mocks__/i18n.ts @@ -1,7 +1,9 @@ import { vi } from 'vitest' +import { ref } from 'vue' import type { st as realSt, t as realT } from '@/i18n' export const t = vi.fn((key) => String(key)) export const st = vi.fn( (key, fallbackMessage) => fallbackMessage || key ) +export const i18n = { global: { locale: ref('en') } } diff --git a/src/platform/account/components/dialogs/settings/BillingTab.vue b/src/platform/account/components/dialogs/settings/BillingTab.vue index e7f06e1c601..9759941f7c0 100644 --- a/src/platform/account/components/dialogs/settings/BillingTab.vue +++ b/src/platform/account/components/dialogs/settings/BillingTab.vue @@ -77,7 +77,7 @@ @@ -146,49 +147,7 @@
-
-

- {{ $t(`workspacePanel.billingTab.handoff.${handoffAudience}.label`) }} -

-
- - - -