[backport cloud/1.35] Fix(cloud)/pricing annual misc (#7704)

Backport of #7701 to `cloud/1.35`

Automatically created by backport workflow.

┆Issue is synchronized with this [Notion
page](https://www.notion.so/PR-7704-backport-cloud-1-35-Fix-cloud-pricing-annual-misc-2d16d73d365081868447db732608a2c7)
by [Unito](https://www.unito.io)

Co-authored-by: Simula_r <18093452+simula-r@users.noreply.github.com>
Co-authored-by: bymyself <cbyrne@comfy.org>
This commit is contained in:
Comfy Org PR Bot
2025-12-22 21:21:24 +09:00
committed by GitHub
parent b81f5fee48
commit 10389e216e
6 changed files with 65 additions and 36 deletions

View File

@@ -12,6 +12,7 @@ const mockIsCancelled = ref(false)
const mockSubscriptionTier = ref<
'STANDARD' | 'CREATOR' | 'PRO' | 'FOUNDERS_EDITION' | null
>('CREATOR')
const mockIsYearlySubscription = ref(false)
const TIER_TO_NAME: Record<string, string> = {
STANDARD: 'Standard',
@@ -27,9 +28,12 @@ const mockSubscriptionData = {
formattedRenewalDate: computed(() => '2024-12-31'),
formattedEndDate: computed(() => '2024-12-31'),
subscriptionTier: computed(() => mockSubscriptionTier.value),
subscriptionTierName: computed(() =>
mockSubscriptionTier.value ? TIER_TO_NAME[mockSubscriptionTier.value] : ''
),
subscriptionTierName: computed(() => {
if (!mockSubscriptionTier.value) return ''
const baseName = TIER_TO_NAME[mockSubscriptionTier.value]
return mockIsYearlySubscription.value ? `${baseName} Yearly` : baseName
}),
isYearlySubscription: computed(() => mockIsYearlySubscription.value),
handleInvoiceHistory: vi.fn()
}
@@ -212,6 +216,7 @@ describe('SubscriptionPanel', () => {
mockIsActiveSubscription.value = false
mockIsCancelled.value = false
mockSubscriptionTier.value = 'CREATOR'
mockIsYearlySubscription.value = false
})
describe('subscription state functionality', () => {