diff --git a/src/platform/workspace/components/UnifiedPricingTable.test.ts b/src/platform/workspace/components/UnifiedPricingTable.test.ts index 6e55bb9197..bee0b83081 100644 --- a/src/platform/workspace/components/UnifiedPricingTable.test.ts +++ b/src/platform/workspace/components/UnifiedPricingTable.test.ts @@ -170,6 +170,26 @@ describe('UnifiedPricingTable team plan CTA', () => { expect(emitted().resubscribe).toBeTruthy() }) + it('changes plan (not re-subscribe) when a cancelled sub picks a different stop', async () => { + const user = userEvent.setup() + mockSubscription.value = { + tier: 'TEAM', + duration: 'ANNUAL', + isCancelled: true + } + mockCurrentTeamCreditStop.value = TEAM_STOP + + const { emitted } = renderComponent({ initialPlanMode: 'team' }) + + await user.click(screen.getByTestId('team-slider')) + + const cta = screen.getByRole('button', { name: 'Change plan' }) + expect(cta).toBeEnabled() + await user.click(cta) + expect(emitted().subscribeTeam).toBeTruthy() + expect(emitted().resubscribe).toBeFalsy() + }) + it('prompts a fresh subscribe when on no team plan', () => { renderComponent({ initialPlanMode: 'team' }) diff --git a/src/platform/workspace/components/UnifiedPricingTable.vue b/src/platform/workspace/components/UnifiedPricingTable.vue index 65353d1533..1cdfe3ffcb 100644 --- a/src/platform/workspace/components/UnifiedPricingTable.vue +++ b/src/platform/workspace/components/UnifiedPricingTable.vue @@ -684,9 +684,13 @@ const teamButtonLabel = computed(() => { ? t('subscription.teamPlan.cta') : t('subscription.teamPlan.ctaMonthly') } - if (isCancelled.value) return t('subscription.resubscribe') - if (isTeamCurrentStopSelected.value) - return t('subscription.teamPlan.currentPlan') + // Only the current stop re-subscribes (cancelled) or reads "Current plan" + // (active); any other stop is a plan change. + if (isTeamCurrentStopSelected.value) { + return isCancelled.value + ? t('subscription.resubscribe') + : t('subscription.teamPlan.currentPlan') + } return t('subscription.teamPlan.changePlan') }) @@ -811,7 +815,8 @@ function handleSubscribe(tierKey: CheckoutTierKey) { function handleSubscribeTeam() { if (isTeamButtonDisabled.value) return - if (isTeamSubscribed.value && isCancelled.value) { + // Re-subscribe only when keeping the current stop; a different stop is a change. + if (isCancelled.value && isTeamCurrentStopSelected.value) { emit('resubscribe') return }