From 282ce01e650af66ddbd6fe2facce484ca6715a70 Mon Sep 17 00:00:00 2001 From: dante01yoon Date: Tue, 1 Sep 2026 17:02:18 +0000 Subject: [PATCH 1/4] fix(billing): drop the ended-subscription card for an Inactive badge MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The amber state card fired for a cancelled or an ended subscription. Cancelled earns it: the plan is still running and the card names the date features stop, so it is a heads-up with a deadline. Ended does not — by then the panel heading, the plan status and the credits tile already say the plan is over, and the card is a fourth telling of the same fact. It is also the wrong treatment, not just redundant. Warning border over warning fill makes it the loudest element in the panel, which puts a terminal, non-actionable state above the payment-failed banner in the visual hierarchy, and it pairs that fill with an info icon our convention reserves for notices. It has no design of record. Gate the card on cancelled-and-still-running and let an Inactive badge on the plan name carry the ended state. The ended card's title and description lose their only caller and are removed from all locales. --- .../tests/dialogs/creditsTile.spec.ts | 4 +- .../tests/dialogs/enterpriseTierCloud.spec.ts | 7 ++- src/locales/ar/main.json | 3 +- src/locales/de/main.json | 3 +- src/locales/en/main.json | 7 +-- src/locales/es/main.json | 3 +- src/locales/fa/main.json | 3 +- src/locales/fr/main.json | 3 +- src/locales/he/main.json | 3 +- src/locales/it/main.json | 3 +- src/locales/ja/main.json | 3 +- src/locales/ko/main.json | 3 +- src/locales/pt-BR/main.json | 3 +- src/locales/ru/main.json | 3 +- src/locales/tr/main.json | 3 +- src/locales/zh-TW/main.json | 3 +- src/locales/zh/main.json | 3 +- .../SubscriptionPanelContentWorkspace.test.ts | 56 ++++++++++++++++--- .../SubscriptionPanelContentWorkspace.vue | 40 +++++++------ 19 files changed, 97 insertions(+), 59 deletions(-) diff --git a/browser_tests/tests/dialogs/creditsTile.spec.ts b/browser_tests/tests/dialogs/creditsTile.spec.ts index 68cfcf08b5b..ad9ba7b8c5c 100644 --- a/browser_tests/tests/dialogs/creditsTile.spec.ts +++ b/browser_tests/tests/dialogs/creditsTile.spec.ts @@ -291,7 +291,9 @@ test.describe('Credits tile (Plan & Credits)', { tag: '@cloud' }, () => { await mockCloudBoot(page, true, endedPersonalBillingStatus) const content = await openPlanAndCredits(page) - await expect(content.getByText('Your subscription has ended')).toBeVisible() + await expect(content.getByText('Your subscription has ended')).toHaveCount( + 0 + ) await content.getByRole('button', { name: 'Billing & invoices' }).click() await expect diff --git a/browser_tests/tests/dialogs/enterpriseTierCloud.spec.ts b/browser_tests/tests/dialogs/enterpriseTierCloud.spec.ts index c8a8402021a..efc6cd9b8a0 100644 --- a/browser_tests/tests/dialogs/enterpriseTierCloud.spec.ts +++ b/browser_tests/tests/dialogs/enterpriseTierCloud.spec.ts @@ -185,10 +185,15 @@ test.describe('Enterprise workspace billing', { tag: '@cloud' }, () => { ) const content = await workspace.openPlanAndCreditsSettings() - await expect(content.getByText('Your subscription has ended')).toBeVisible() + await expect(content.getByText('Your subscription has ended')).toHaveCount( + 0 + ) await expect( content.getByRole('heading', { name: 'Enterprise' }) ).toBeVisible() + await expect(content.getByTestId('plan-status-badge')).toHaveText( + 'Inactive' + ) await expect( content.getByRole('button', { name: 'Add credits' }) ).toBeVisible() diff --git a/src/locales/ar/main.json b/src/locales/ar/main.json index f19f1e4d0ac..bc6d3fa02b3 100644 --- a/src/locales/ar/main.json +++ b/src/locales/ar/main.json @@ -4273,8 +4273,6 @@ "canceledCard": { "description": "لن يتم خصم أي رسوم أخرى منك. ستبقى ميزاتك نشطة حتى {date}.", "descriptionWithoutDate": "لن يتم خصم أي رسوم أخرى. ستبقى ميزاتك نشطة حتى نهاية فترة الفوترة.", - "endedDescription": "لم يعد اشتراكك نشطًا.", - "endedTitle": "انتهى اشتراكك", "title": "تم إلغاء اشتراكك" }, "changePlan": "تغيير الخطة", @@ -4329,6 +4327,7 @@ "gpuLabel": "RTX 6000 Pro (ذاكرة 96GB VRAM)", "haveQuestions": "هل لديك أسئلة أو ترغب في معرفة المزيد عن المؤسسات؟", "inactive": { + "badge": "غير نشط", "memberCta": "حسنًا، فهمت", "memberDescription": "اطلب من مالك مساحة العمل إعادة تفعيل الاشتراك لتشغيل سير العمل.", "memberRunTooltip": "تواصل مع مالك مساحة العمل لإعادة الاشتراك", diff --git a/src/locales/de/main.json b/src/locales/de/main.json index 9c100bc6a6e..276b8f4d820 100644 --- a/src/locales/de/main.json +++ b/src/locales/de/main.json @@ -4273,8 +4273,6 @@ "canceledCard": { "description": "Ihnen werden keine weiteren Kosten berechnet. Ihre Funktionen bleiben bis {date} aktiv.", "descriptionWithoutDate": "Ihnen werden keine weiteren Kosten berechnet. Ihre Funktionen bleiben bis zum Ende Ihres Abrechnungszeitraums aktiv.", - "endedDescription": "Ihr Abonnement ist nicht mehr aktiv.", - "endedTitle": "Ihr Abonnement ist beendet", "title": "Ihr Abonnement wurde gekündigt" }, "changePlan": "Plan ändern", @@ -4329,6 +4327,7 @@ "gpuLabel": "RTX 6000 Pro (96GB VRAM)", "haveQuestions": "Haben Sie Fragen oder interessieren Sie sich für Enterprise?", "inactive": { + "badge": "Inaktiv", "memberCta": "OK, verstanden", "memberDescription": "Bitten Sie den Workspace-Inhaber, das Abonnement des Workspace zu reaktivieren, um Workflows auszuführen.", "memberRunTooltip": "Wenden Sie sich an den Workspace-Inhaber, um das Abonnement erneut abzuschließen", diff --git a/src/locales/en/main.json b/src/locales/en/main.json index 5bb416a2d67..891a1328657 100644 --- a/src/locales/en/main.json +++ b/src/locales/en/main.json @@ -2813,9 +2813,7 @@ "canceledCard": { "title": "Your subscription has been canceled", "description": "You won't be charged again. Your features remain active until {date}.", - "descriptionWithoutDate": "You won't be charged again. Your features remain active until the end of your billing period.", - "endedTitle": "Your subscription has ended", - "endedDescription": "Your subscription is no longer active." + "descriptionWithoutDate": "You won't be charged again. Your features remain active until the end of your billing period." }, "cancelSuccess": "Subscription cancelled successfully", "cancelDialog": { @@ -2956,7 +2954,8 @@ "memberDescription": "Ask your workspace owner to reactivate the workspace's subscription to run workflows.", "memberCta": "Ok, got it", "memberRunTooltip": "Contact your workspace owner to resubscribe", - "runLabel": "Run" + "runLabel": "Run", + "badge": "Inactive" }, "paymentRecovery": { "title": "Subscription paused", diff --git a/src/locales/es/main.json b/src/locales/es/main.json index 4c63ae69005..6afd5f5fd9a 100644 --- a/src/locales/es/main.json +++ b/src/locales/es/main.json @@ -4273,8 +4273,6 @@ "canceledCard": { "description": "No se te cobrará de nuevo. Tus funciones seguirán activas hasta {date}.", "descriptionWithoutDate": "No se te volverá a cobrar. Tus funciones seguirán activas hasta el final de tu periodo de facturación.", - "endedDescription": "Tu suscripción ya no está activa.", - "endedTitle": "Tu suscripción ha finalizado", "title": "Tu suscripción ha sido cancelada" }, "changePlan": "Cambiar plan", @@ -4329,6 +4327,7 @@ "gpuLabel": "RTX 6000 Pro (96GB VRAM)", "haveQuestions": "¿Tienes preguntas o buscas soluciones empresariales?", "inactive": { + "badge": "Inactiva", "memberCta": "Ok, entendido", "memberDescription": "Pide al propietario del espacio de trabajo que reactive la suscripción para ejecutar flujos de trabajo.", "memberRunTooltip": "Contacta al propietario del espacio de trabajo para volver a suscribirte", diff --git a/src/locales/fa/main.json b/src/locales/fa/main.json index db878d1b0e3..13e83b95c66 100644 --- a/src/locales/fa/main.json +++ b/src/locales/fa/main.json @@ -4273,8 +4273,6 @@ "canceledCard": { "description": "دیگر هزینه‌ای از شما دریافت نمی‌شود. امکانات شما تا تاریخ {date} فعال خواهد بود.", "descriptionWithoutDate": "دیگر هزینه‌ای از شما دریافت نمی‌شود. امکانات شما تا پایان دوره صورتحساب فعال خواهد بود.", - "endedDescription": "اشتراک شما دیگر فعال نیست.", - "endedTitle": "اشتراک شما به پایان رسیده است", "title": "اشتراک شما لغو شده است" }, "changePlan": "تغییر پلن", @@ -4329,6 +4327,7 @@ "gpuLabel": "RTX 6000 Pro (۹۶ گیگابایت VRAM)", "haveQuestions": "سوالی دارید یا به دنبال راهکار سازمانی هستید؟", "inactive": { + "badge": "غیرفعال", "memberCta": "باشه، متوجه شدم", "memberDescription": "از مالک فضای کاری خود بخواهید تا اشتراک را برای اجرای workflowها فعال کند.", "memberRunTooltip": "برای تمدید اشتراک با مالک فضای کاری تماس بگیرید", diff --git a/src/locales/fr/main.json b/src/locales/fr/main.json index f8244787852..04d86afdc85 100644 --- a/src/locales/fr/main.json +++ b/src/locales/fr/main.json @@ -4273,8 +4273,6 @@ "canceledCard": { "description": "Vous ne serez plus facturé. Vos fonctionnalités restent actives jusqu'au {date}.", "descriptionWithoutDate": "Vous ne serez plus facturé. Vos fonctionnalités restent actives jusqu’à la fin de votre période de facturation.", - "endedDescription": "Votre abonnement n’est plus actif.", - "endedTitle": "Votre abonnement a pris fin", "title": "Votre abonnement a été annulé" }, "changePlan": "Changer d’abonnement", @@ -4329,6 +4327,7 @@ "gpuLabel": "RTX 6000 Pro (96GB VRAM)", "haveQuestions": "Des questions ou besoin d'une offre entreprise ?", "inactive": { + "badge": "Inactif", "memberCta": "Ok, compris", "memberDescription": "Demandez au propriétaire de l’espace de travail de réactiver l’abonnement pour exécuter des workflows.", "memberRunTooltip": "Contactez le propriétaire de votre espace de travail pour réactiver l’abonnement", diff --git a/src/locales/he/main.json b/src/locales/he/main.json index 2c69a06689a..f3389b1507c 100644 --- a/src/locales/he/main.json +++ b/src/locales/he/main.json @@ -4273,8 +4273,6 @@ "canceledCard": { "description": "לא תחויב שוב. התכונות שלך יישארו פעילות עד {date}.", "descriptionWithoutDate": "לא תחויבו שוב. הפיצ'רים שלכם יישארו פעילים עד לסיום תקופת החיוב.", - "endedDescription": "המנוי שלכם אינו פעיל יותר.", - "endedTitle": "המנוי שלכם הסתיים", "title": "המנוי שלך בוטל" }, "changePlan": "שנה תוכנית", @@ -4329,6 +4327,7 @@ "gpuLabel": "RTX 6000 Pro (96GB VRAM)", "haveQuestions": "יש לך שאלות או מתעניין במסלול ארגוני (enterprise)?", "inactive": { + "badge": "לא פעיל", "memberCta": "הבנתי", "memberDescription": "פנה לבעלים של מרחב העבודה כדי להפעיל מחדש את המנוי ולהריץ תהליכי עבודה.", "memberRunTooltip": "פנה לבעלים של מרחב העבודה כדי לחדש מנוי", diff --git a/src/locales/it/main.json b/src/locales/it/main.json index 538e7955334..bd246359e5a 100644 --- a/src/locales/it/main.json +++ b/src/locales/it/main.json @@ -4273,8 +4273,6 @@ "canceledCard": { "description": "Non ti verrà più addebitato nulla. Le tue funzionalità rimarranno attive fino al {date}.", "descriptionWithoutDate": "Non ti verrà più addebitato nulla. Le tue funzionalità rimarranno attive fino alla fine del periodo di fatturazione.", - "endedDescription": "Il tuo abbonamento non è più attivo.", - "endedTitle": "Il tuo abbonamento è terminato", "title": "Il tuo abbonamento è stato annullato" }, "changePlan": "Cambia piano", @@ -4329,6 +4327,7 @@ "gpuLabel": "RTX 6000 Pro (96GB VRAM)", "haveQuestions": "Hai domande o sei interessato all'enterprise?", "inactive": { + "badge": "Inattivo", "memberCta": "Ok, capito", "memberDescription": "Chiedi al proprietario del workspace di riattivare l'abbonamento per eseguire workflow.", "memberRunTooltip": "Contatta il proprietario del workspace per riabbonarsi", diff --git a/src/locales/ja/main.json b/src/locales/ja/main.json index 16d88143e4e..edd7d5b0b33 100644 --- a/src/locales/ja/main.json +++ b/src/locales/ja/main.json @@ -4273,8 +4273,6 @@ "canceledCard": { "description": "今後請求されることはありません。{date}まで機能は有効です。", "descriptionWithoutDate": "今後請求は発生しません。機能は請求期間の終了まで有効です。", - "endedDescription": "サブスクリプションは無効になりました。", - "endedTitle": "サブスクリプションが終了しました", "title": "サブスクリプションはキャンセルされました" }, "changePlan": "プランを変更", @@ -4329,6 +4327,7 @@ "gpuLabel": "RTX 6000 Pro(96GB VRAM)", "haveQuestions": "ご質問やエンタープライズについてのお問い合わせはこちら", "inactive": { + "badge": "無効", "memberCta": "了解しました", "memberDescription": "ワークスペースのオーナーに連絡して、サブスクリプションを再有効化してワークフローを実行してください。", "memberRunTooltip": "ワークスペースのオーナーに再購読を依頼してください", diff --git a/src/locales/ko/main.json b/src/locales/ko/main.json index 010b92309c0..4ee8ce3f043 100644 --- a/src/locales/ko/main.json +++ b/src/locales/ko/main.json @@ -4273,8 +4273,6 @@ "canceledCard": { "description": "더 이상 결제되지 않습니다. {date}까지 기능을 계속 사용할 수 있습니다.", "descriptionWithoutDate": "더 이상 결제되지 않습니다. 현재 결제 주기까지 기능이 계속 활성화됩니다.", - "endedDescription": "구독이 더 이상 활성화되어 있지 않습니다.", - "endedTitle": "구독이 종료되었습니다", "title": "구독이 취소되었습니다" }, "changePlan": "요금제 변경", @@ -4329,6 +4327,7 @@ "gpuLabel": "RTX 6000 Pro (96GB VRAM)", "haveQuestions": "질문이 있거나 엔터프라이즈가 궁금하신가요?", "inactive": { + "badge": "비활성", "memberCta": "확인", "memberDescription": "워크스페이스 소유자에게 구독을 다시 활성화하여 워크플로우를 실행할 수 있도록 요청하세요.", "memberRunTooltip": "워크스페이스 소유자에게 재구독을 문의하세요", diff --git a/src/locales/pt-BR/main.json b/src/locales/pt-BR/main.json index 22f5294eef7..97084c3b80e 100644 --- a/src/locales/pt-BR/main.json +++ b/src/locales/pt-BR/main.json @@ -4273,8 +4273,6 @@ "canceledCard": { "description": "Você não será mais cobrado. Seus recursos permanecem ativos até {date}.", "descriptionWithoutDate": "Você não será cobrado novamente. Seus recursos permanecem ativos até o final do seu período de cobrança.", - "endedDescription": "Sua assinatura não está mais ativa.", - "endedTitle": "Sua assinatura foi encerrada", "title": "Sua assinatura foi cancelada" }, "changePlan": "Alterar plano", @@ -4329,6 +4327,7 @@ "gpuLabel": "RTX 6000 Pro (96GB VRAM)", "haveQuestions": "Tem dúvidas ou interesse em soluções empresariais?", "inactive": { + "badge": "Inativo", "memberCta": "Ok, entendi", "memberDescription": "Peça ao proprietário do workspace para reativar a assinatura e executar fluxos de trabalho.", "memberRunTooltip": "Entre em contato com o proprietário do workspace para reativar a assinatura", diff --git a/src/locales/ru/main.json b/src/locales/ru/main.json index dbb70209559..090e3718d78 100644 --- a/src/locales/ru/main.json +++ b/src/locales/ru/main.json @@ -4273,8 +4273,6 @@ "canceledCard": { "description": "С вас больше не будет взиматься плата. Ваши функции останутся активными до {date}.", "descriptionWithoutDate": "С вас больше не будет взиматься плата. Ваши функции останутся активными до конца расчетного периода.", - "endedDescription": "Ваша подписка больше не активна.", - "endedTitle": "Ваша подписка завершена", "title": "Ваша подписка отменена" }, "changePlan": "Сменить тариф", @@ -4329,6 +4327,7 @@ "gpuLabel": "RTX 6000 Pro (96ГБ VRAM)", "haveQuestions": "Есть вопросы или интересует корпоративное решение?", "inactive": { + "badge": "Неактивно", "memberCta": "Ок, понятно", "memberDescription": "Попросите владельца рабочего пространства возобновить подписку, чтобы запускать рабочие процессы.", "memberRunTooltip": "Свяжитесь с владельцем рабочего пространства для повторной подписки", diff --git a/src/locales/tr/main.json b/src/locales/tr/main.json index 7334a7b0a77..21065f446b9 100644 --- a/src/locales/tr/main.json +++ b/src/locales/tr/main.json @@ -4273,8 +4273,6 @@ "canceledCard": { "description": "Tekrar ücretlendirilmeyeceksiniz. Özellikleriniz {date} tarihine kadar aktif kalacak.", "descriptionWithoutDate": "Tekrar ücretlendirilmeyeceksiniz. Özellikleriniz fatura dönemi sonuna kadar aktif kalacak.", - "endedDescription": "Aboneliğiniz artık aktif değil.", - "endedTitle": "Aboneliğiniz sona erdi", "title": "Aboneliğiniz iptal edildi" }, "changePlan": "Planı değiştir", @@ -4329,6 +4327,7 @@ "gpuLabel": "RTX 6000 Pro (96GB VRAM)", "haveQuestions": "Sorularınız mı var veya kurumsal çözüm mü arıyorsunuz?", "inactive": { + "badge": "Pasif", "memberCta": "Tamam, anladım", "memberDescription": "Çalışma alanı sahibinizden iş akışlarını çalıştırmak için aboneliği yeniden etkinleştirmesini isteyin.", "memberRunTooltip": "Yeniden abone olmak için çalışma alanı sahibinizle iletişime geçin", diff --git a/src/locales/zh-TW/main.json b/src/locales/zh-TW/main.json index 4d8e1411b66..06ceec195b1 100644 --- a/src/locales/zh-TW/main.json +++ b/src/locales/zh-TW/main.json @@ -4273,8 +4273,6 @@ "canceledCard": { "description": "您將不會再次被收費。您的功能將持續至 {date}。", "descriptionWithoutDate": "您將不會再次被收費。您的功能會持續啟用至本期帳單結束。", - "endedDescription": "您的訂閱已不再有效。", - "endedTitle": "您的訂閱已結束", "title": "您的訂閱已取消" }, "changePlan": "更改方案", @@ -4329,6 +4327,7 @@ "gpuLabel": "RTX 6000 Pro(96GB VRAM)", "haveQuestions": "有疑問或想了解企業方案?", "inactive": { + "badge": "已停用", "memberCta": "好的,知道了", "memberDescription": "請聯絡您的工作區擁有者以重新啟用訂閱,才能執行工作流程。", "memberRunTooltip": "請聯絡您的工作區擁有者重新訂閱", diff --git a/src/locales/zh/main.json b/src/locales/zh/main.json index d82aebd5327..949d5eeb05f 100644 --- a/src/locales/zh/main.json +++ b/src/locales/zh/main.json @@ -4273,8 +4273,6 @@ "canceledCard": { "description": "您将不再被扣费。您的功能将在 {date} 前保持激活。", "descriptionWithoutDate": "您将不会再次被扣费。您的功能将在本计费周期结束前保持激活状态。", - "endedDescription": "您的订阅已不再激活。", - "endedTitle": "您的订阅已结束", "title": "您的订阅已被取消" }, "changePlan": "更改套餐", @@ -4329,6 +4327,7 @@ "gpuLabel": "RTX 6000 Pro (96GB VRAM)", "haveQuestions": "对企业级有疑问?", "inactive": { + "badge": "已失效", "memberCta": "好的,知道了", "memberDescription": "请联系您的工作区所有者,重新激活订阅以运行工作流。", "memberRunTooltip": "请联系您的工作区所有者重新订阅", diff --git a/src/platform/workspace/components/SubscriptionPanelContentWorkspace.test.ts b/src/platform/workspace/components/SubscriptionPanelContentWorkspace.test.ts index c061517a40e..0075161cada 100644 --- a/src/platform/workspace/components/SubscriptionPanelContentWorkspace.test.ts +++ b/src/platform/workspace/components/SubscriptionPanelContentWorkspace.test.ts @@ -306,6 +306,11 @@ const SubscriptionFooterLinksStub = { '
' } +const StatusBadgeStub = { + props: ['label', 'severity'], + template: '{{ label }}' +} + const DropdownMenuStub = { props: ['entries'], template: @@ -323,7 +328,7 @@ function renderComponent({ stubFooter = true } = {}) { ...(stubFooter ? { SubscriptionFooterLinks: SubscriptionFooterLinksStub } : {}), - StatusBadge: true, + StatusBadge: StatusBadgeStub, DropdownMenu: DropdownMenuStub } } @@ -497,6 +502,33 @@ describe('SubscriptionPanelContentWorkspace', () => { ).not.toBeInTheDocument() }) + it('marks an ended Enterprise plan inactive without the state card', () => { + useEnterprisePlan() + mockSubscriptionStatus.value = 'ended' + mockIsActiveSubscription.value = false + renderComponent() + + expect(screen.getByTestId('plan-status-badge')).toHaveTextContent( + 'Inactive' + ) + expect(screen.getByTestId('plan-status-badge')).toHaveAttribute( + 'data-severity', + 'secondary' + ) + expect( + screen.queryByText('Your subscription has ended') + ).not.toBeInTheDocument() + }) + + it('keeps the cancelled badge while an Enterprise plan still runs', () => { + useEnterprisePlan() + mockSubscriptionStatus.value = 'canceled' + renderComponent() + + expect(screen.getByText('Canceled')).toBeInTheDocument() + expect(screen.queryByText('Inactive')).not.toBeInTheDocument() + }) + it('renders an unrecognized tier as Current plan without catalog content', () => { mockHasTeamPlan.value = false mockSubscriptionTier.value = runtimeTier('GALACTIC') @@ -706,7 +738,9 @@ describe('SubscriptionPanelContentWorkspace', () => { mockBillingStatus.value = 'inactive' renderComponent() - expect(screen.getByText('Your subscription has ended')).toBeInTheDocument() + expect( + screen.queryByText('Your subscription has ended') + ).not.toBeInTheDocument() expect(screen.getByRole('heading', { name: 'Free' })).toBeInTheDocument() await user.click(screen.getByRole('button', { name: 'Billing & invoices' })) expect(mockManageSubscription).toHaveBeenCalledOnce() @@ -794,17 +828,19 @@ describe('SubscriptionPanelContentWorkspace', () => { expect(mockShowSubscriptionDialog).not.toHaveBeenCalled() }) - it('shows ended copy for an inactive ended subscription without a date', () => { + it('drops the state card for an inactive ended subscription without a date', () => { mockSubscriptionStatus.value = 'ended' mockIsActiveSubscription.value = false mockIsInPersonalWorkspace.value = true mockEndDate.value = null renderComponent() - expect(screen.getByText('Your subscription has ended')).toBeInTheDocument() expect( - screen.getByText('Your subscription is no longer active.') - ).toBeInTheDocument() + screen.queryByText('Your subscription has ended') + ).not.toBeInTheDocument() + expect( + screen.queryByText('Your subscription is no longer active.') + ).not.toBeInTheDocument() expect( screen.queryByText(/features remain active/i) ).not.toBeInTheDocument() @@ -838,7 +874,9 @@ describe('SubscriptionPanelContentWorkspace', () => { const user = userEvent.setup() renderComponent() - expect(screen.getByText('Your subscription has ended')).toBeInTheDocument() + expect( + screen.queryByText('Your subscription has ended') + ).not.toBeInTheDocument() expect( screen.getByRole('heading', { name: 'Inactive team subscription' }) ).toBeInTheDocument() @@ -901,7 +939,9 @@ describe('SubscriptionPanelContentWorkspace', () => { mockSubscriptionStatus.value = 'ended' renderComponent() - expect(screen.getByText('Your subscription has ended')).toBeInTheDocument() + expect( + screen.queryByText('Your subscription has ended') + ).not.toBeInTheDocument() expect(screen.queryByText(/^Renews on/i)).not.toBeInTheDocument() }) diff --git a/src/platform/workspace/components/SubscriptionPanelContentWorkspace.vue b/src/platform/workspace/components/SubscriptionPanelContentWorkspace.vue index a8a43da6230..aade6e338f5 100644 --- a/src/platform/workspace/components/SubscriptionPanelContentWorkspace.vue +++ b/src/platform/workspace/components/SubscriptionPanelContentWorkspace.vue @@ -220,9 +220,10 @@ {{ planDisplayName }}
{ }) const showSubscriptionStateCard = computed( - () => isSubscriptionCancelled.value || isSubscriptionEnded.value + () => isSubscriptionCancelled.value && !isSubscriptionEnded.value ) const subscriptionStateCardTitle = computed(() => - isSubscriptionEnded.value - ? t('subscription.canceledCard.endedTitle') - : t('subscription.canceledCard.title') + t('subscription.canceledCard.title') ) -const subscriptionStateCardDescription = computed(() => { - if (isSubscriptionEnded.value) { - return t('subscription.canceledCard.endedDescription') - } - if (!formattedEndDate.value) { - return t('subscription.canceledCard.descriptionWithoutDate') - } - return t('subscription.canceledCard.description', { - date: formattedEndDate.value - }) +const subscriptionStateCardDescription = computed(() => + formattedEndDate.value + ? t('subscription.canceledCard.description', { + date: formattedEndDate.value + }) + : t('subscription.canceledCard.descriptionWithoutDate') +) + +const planStatusBadge = computed(() => { + if (isSubscriptionEnded.value && !isInPersonalWorkspace.value) + return { + label: t('subscription.inactive.badge'), + severity: 'secondary' as const + } + if (isSubscriptionCancelled.value) + return { label: t('subscription.canceled'), severity: 'warn' as const } + return null }) const planDateDisplay = computed(() => { From dba4ae297310c21df23e08751f8ed0ed95471594 Mon Sep 17 00:00:00 2001 From: dante01yoon Date: Tue, 1 Sep 2026 17:48:02 +0000 Subject: [PATCH 2/4] test(billing): assert the state card itself, not its removed copy MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The ended-state assertions keyed on "Your subscription has ended", a string this branch deletes from every locale. A query for text that can no longer render always passes, so those six assertions would have gone on passing had the card kept rendering for an ended subscription — the exact regression they exist to catch. Give the card a data-testid and assert on the element. Where an ended case asserted both removed strings plus the cancelled description, one absence check on the card now covers all three. Pin the other direction too: a cancelled Enterprise plan that is still running keeps the card, not just the Canceled badge. --- .../tests/dialogs/creditsTile.spec.ts | 4 +--- .../tests/dialogs/enterpriseTierCloud.spec.ts | 4 +--- .../SubscriptionPanelContentWorkspace.test.ts | 19 +++++++------------ .../SubscriptionPanelContentWorkspace.vue | 1 + 4 files changed, 10 insertions(+), 18 deletions(-) diff --git a/browser_tests/tests/dialogs/creditsTile.spec.ts b/browser_tests/tests/dialogs/creditsTile.spec.ts index ad9ba7b8c5c..12431c1a4f2 100644 --- a/browser_tests/tests/dialogs/creditsTile.spec.ts +++ b/browser_tests/tests/dialogs/creditsTile.spec.ts @@ -291,9 +291,7 @@ test.describe('Credits tile (Plan & Credits)', { tag: '@cloud' }, () => { await mockCloudBoot(page, true, endedPersonalBillingStatus) const content = await openPlanAndCredits(page) - await expect(content.getByText('Your subscription has ended')).toHaveCount( - 0 - ) + await expect(content.getByTestId('subscription-state-card')).toHaveCount(0) await content.getByRole('button', { name: 'Billing & invoices' }).click() await expect diff --git a/browser_tests/tests/dialogs/enterpriseTierCloud.spec.ts b/browser_tests/tests/dialogs/enterpriseTierCloud.spec.ts index efc6cd9b8a0..560ad850483 100644 --- a/browser_tests/tests/dialogs/enterpriseTierCloud.spec.ts +++ b/browser_tests/tests/dialogs/enterpriseTierCloud.spec.ts @@ -185,9 +185,7 @@ test.describe('Enterprise workspace billing', { tag: '@cloud' }, () => { ) const content = await workspace.openPlanAndCreditsSettings() - await expect(content.getByText('Your subscription has ended')).toHaveCount( - 0 - ) + await expect(content.getByTestId('subscription-state-card')).toHaveCount(0) await expect( content.getByRole('heading', { name: 'Enterprise' }) ).toBeVisible() diff --git a/src/platform/workspace/components/SubscriptionPanelContentWorkspace.test.ts b/src/platform/workspace/components/SubscriptionPanelContentWorkspace.test.ts index 0075161cada..a3dd4133b92 100644 --- a/src/platform/workspace/components/SubscriptionPanelContentWorkspace.test.ts +++ b/src/platform/workspace/components/SubscriptionPanelContentWorkspace.test.ts @@ -516,7 +516,7 @@ describe('SubscriptionPanelContentWorkspace', () => { 'secondary' ) expect( - screen.queryByText('Your subscription has ended') + screen.queryByTestId('subscription-state-card') ).not.toBeInTheDocument() }) @@ -527,6 +527,7 @@ describe('SubscriptionPanelContentWorkspace', () => { expect(screen.getByText('Canceled')).toBeInTheDocument() expect(screen.queryByText('Inactive')).not.toBeInTheDocument() + expect(screen.getByTestId('subscription-state-card')).toBeInTheDocument() }) it('renders an unrecognized tier as Current plan without catalog content', () => { @@ -739,7 +740,7 @@ describe('SubscriptionPanelContentWorkspace', () => { renderComponent() expect( - screen.queryByText('Your subscription has ended') + screen.queryByTestId('subscription-state-card') ).not.toBeInTheDocument() expect(screen.getByRole('heading', { name: 'Free' })).toBeInTheDocument() await user.click(screen.getByRole('button', { name: 'Billing & invoices' })) @@ -782,7 +783,7 @@ describe('SubscriptionPanelContentWorkspace', () => { expect(screen.getByRole('heading', { name: 'Team' })).toBeInTheDocument() expect( - screen.queryByText('Your subscription has ended') + screen.queryByTestId('subscription-state-card') ).not.toBeInTheDocument() expect( screen.queryByRole('button', { name: 'Subscribe' }) @@ -836,13 +837,7 @@ describe('SubscriptionPanelContentWorkspace', () => { renderComponent() expect( - screen.queryByText('Your subscription has ended') - ).not.toBeInTheDocument() - expect( - screen.queryByText('Your subscription is no longer active.') - ).not.toBeInTheDocument() - expect( - screen.queryByText(/features remain active/i) + screen.queryByTestId('subscription-state-card') ).not.toBeInTheDocument() expect(screen.queryByText(/^Ends on/i)).not.toBeInTheDocument() expect( @@ -875,7 +870,7 @@ describe('SubscriptionPanelContentWorkspace', () => { renderComponent() expect( - screen.queryByText('Your subscription has ended') + screen.queryByTestId('subscription-state-card') ).not.toBeInTheDocument() expect( screen.getByRole('heading', { name: 'Inactive team subscription' }) @@ -940,7 +935,7 @@ describe('SubscriptionPanelContentWorkspace', () => { renderComponent() expect( - screen.queryByText('Your subscription has ended') + screen.queryByTestId('subscription-state-card') ).not.toBeInTheDocument() expect(screen.queryByText(/^Renews on/i)).not.toBeInTheDocument() }) diff --git a/src/platform/workspace/components/SubscriptionPanelContentWorkspace.vue b/src/platform/workspace/components/SubscriptionPanelContentWorkspace.vue index aade6e338f5..287fb9551c6 100644 --- a/src/platform/workspace/components/SubscriptionPanelContentWorkspace.vue +++ b/src/platform/workspace/components/SubscriptionPanelContentWorkspace.vue @@ -55,6 +55,7 @@
Date: Tue, 1 Sep 2026 23:21:31 +0000 Subject: [PATCH 3/4] fix(billing): mark an ended Personal plan inactive too MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Dropping the ended card left the Personal case with nothing in its place. The badge was gated on being outside a Personal workspace, so a lapsed Personal plan that cannot self-serve rendered its old paid identity and price beside a Cancel plan button, with no badge, no card and a blank date — reading as a live subscription. The card it replaced never made that distinction, so the badge should not either. Ended is ended, wherever the workspace lives. --- .../SubscriptionPanelContentWorkspace.test.ts | 16 ++++++++++++++++ .../SubscriptionPanelContentWorkspace.vue | 2 +- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/src/platform/workspace/components/SubscriptionPanelContentWorkspace.test.ts b/src/platform/workspace/components/SubscriptionPanelContentWorkspace.test.ts index a3dd4133b92..d08c4e24b43 100644 --- a/src/platform/workspace/components/SubscriptionPanelContentWorkspace.test.ts +++ b/src/platform/workspace/components/SubscriptionPanelContentWorkspace.test.ts @@ -520,6 +520,22 @@ describe('SubscriptionPanelContentWorkspace', () => { ).not.toBeInTheDocument() }) + it('marks an ended Personal plan inactive when it cannot self-serve', () => { + mockIsInPersonalWorkspace.value = true + mockIsActiveSubscription.value = false + mockSubscriptionStatus.value = 'ended' + mockBillingStatus.value = 'inactive' + mockCanSubscribeSelfServe.value = false + renderComponent() + + expect(screen.getByTestId('plan-status-badge')).toHaveTextContent( + 'Inactive' + ) + expect( + screen.queryByTestId('subscription-state-card') + ).not.toBeInTheDocument() + }) + it('keeps the cancelled badge while an Enterprise plan still runs', () => { useEnterprisePlan() mockSubscriptionStatus.value = 'canceled' diff --git a/src/platform/workspace/components/SubscriptionPanelContentWorkspace.vue b/src/platform/workspace/components/SubscriptionPanelContentWorkspace.vue index 287fb9551c6..25cc18b56b8 100644 --- a/src/platform/workspace/components/SubscriptionPanelContentWorkspace.vue +++ b/src/platform/workspace/components/SubscriptionPanelContentWorkspace.vue @@ -633,7 +633,7 @@ const subscriptionStateCardDescription = computed(() => ) const planStatusBadge = computed(() => { - if (isSubscriptionEnded.value && !isInPersonalWorkspace.value) + if (isSubscriptionEnded.value) return { label: t('subscription.inactive.badge'), severity: 'secondary' as const From 00d56b4c4b09ffa35abf171c034dd33f0da2d1d2 Mon Sep 17 00:00:00 2001 From: dante01yoon Date: Wed, 2 Sep 2026 00:38:02 +0000 Subject: [PATCH 4/4] test(billing): let the card-absence checks see a rendered panel first MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit toHaveCount(0) is satisfied by an empty page, so both card-removal regressions could pass against a panel that had not finished loading — the card could come back and the tests would stay green. Order a positive signal ahead of each absence check: the Enterprise heading and Inactive badge in the sales-managed spec, and the billing portal button in the Personal one, which renders whichever branch that workspace takes. --- browser_tests/tests/dialogs/creditsTile.spec.ts | 6 +++++- browser_tests/tests/dialogs/enterpriseTierCloud.spec.ts | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/browser_tests/tests/dialogs/creditsTile.spec.ts b/browser_tests/tests/dialogs/creditsTile.spec.ts index 12431c1a4f2..488952f301c 100644 --- a/browser_tests/tests/dialogs/creditsTile.spec.ts +++ b/browser_tests/tests/dialogs/creditsTile.spec.ts @@ -291,8 +291,12 @@ test.describe('Credits tile (Plan & Credits)', { tag: '@cloud' }, () => { await mockCloudBoot(page, true, endedPersonalBillingStatus) const content = await openPlanAndCredits(page) + const billingPortal = content.getByRole('button', { + name: 'Billing & invoices' + }) + await expect(billingPortal).toBeVisible() await expect(content.getByTestId('subscription-state-card')).toHaveCount(0) - await content.getByRole('button', { name: 'Billing & invoices' }).click() + await billingPortal.click() await expect .poll(() => page.locator('html').getAttribute('data-opened-url')) diff --git a/browser_tests/tests/dialogs/enterpriseTierCloud.spec.ts b/browser_tests/tests/dialogs/enterpriseTierCloud.spec.ts index 560ad850483..49f2d82301b 100644 --- a/browser_tests/tests/dialogs/enterpriseTierCloud.spec.ts +++ b/browser_tests/tests/dialogs/enterpriseTierCloud.spec.ts @@ -185,13 +185,13 @@ test.describe('Enterprise workspace billing', { tag: '@cloud' }, () => { ) const content = await workspace.openPlanAndCreditsSettings() - await expect(content.getByTestId('subscription-state-card')).toHaveCount(0) await expect( content.getByRole('heading', { name: 'Enterprise' }) ).toBeVisible() await expect(content.getByTestId('plan-status-badge')).toHaveText( 'Inactive' ) + await expect(content.getByTestId('subscription-state-card')).toHaveCount(0) await expect( content.getByRole('button', { name: 'Add credits' }) ).toBeVisible()