diff --git a/src/platform/cloud/subscription/components/SubscriptionPanel.test.ts b/src/platform/cloud/subscription/components/SubscriptionPanel.test.ts index b366ceb0c5..7810a56dcd 100644 --- a/src/platform/cloud/subscription/components/SubscriptionPanel.test.ts +++ b/src/platform/cloud/subscription/components/SubscriptionPanel.test.ts @@ -101,6 +101,7 @@ vi.mock('@/composables/billing/useBillingContext', () => ({ const i18n = createI18n({ legacy: false, locale: 'en', + escapeParameter: true, messages: { en: { subscription: { @@ -112,7 +113,8 @@ const i18n = createI18n({ partnerNodesBalance: 'Partner Nodes Balance', partnerNodesDescription: 'Credits for partner nodes', totalCredits: 'Total Credits', - creditsRemainingThisMonth: 'Credits remaining this month', + creditsRemainingThisMonth: 'Included (Refills {date})', + creditsRemainingThisYear: 'Included (Refills {date})', creditsYouveAdded: "Credits you've added", monthlyBonusDescription: 'Monthly bonus', prepaidDescription: 'Prepaid credits', @@ -286,6 +288,13 @@ describe('SubscriptionPanel', () => { const wrapper = createWrapper() expect(wrapper.findAll('.skeleton').length).toBe(0) }) + + it('renders refill date with literal slashes', () => { + mockIsActiveSubscription.value = true + const wrapper = createWrapper() + expect(wrapper.text()).toContain('Included (Refills 12/31/24)') + expect(wrapper.text()).not.toContain('/') + }) }) // TODO: Re-enable when migrating to VTL so we can find by user visible content. diff --git a/src/platform/cloud/subscription/components/SubscriptionPanelContentLegacy.vue b/src/platform/cloud/subscription/components/SubscriptionPanelContentLegacy.vue index e7098e5336..c32e00c729 100644 --- a/src/platform/cloud/subscription/components/SubscriptionPanelContentLegacy.vue +++ b/src/platform/cloud/subscription/components/SubscriptionPanelContentLegacy.vue @@ -256,12 +256,24 @@ const refillsDate = computed(() => { const creditsRemainingLabel = computed(() => isYearlySubscription.value - ? t('subscription.creditsRemainingThisYear', { - date: refillsDate.value - }) - : t('subscription.creditsRemainingThisMonth', { - date: refillsDate.value - }) + ? t( + 'subscription.creditsRemainingThisYear', + { + date: refillsDate.value + }, + { + escapeParameter: false + } + ) + : t( + 'subscription.creditsRemainingThisMonth', + { + date: refillsDate.value + }, + { + escapeParameter: false + } + ) ) const planTotalCredits = computed(() => { diff --git a/src/platform/workspace/components/SubscriptionPanelContentWorkspace.vue b/src/platform/workspace/components/SubscriptionPanelContentWorkspace.vue index 6ab7b083d0..d4c0d068e9 100644 --- a/src/platform/workspace/components/SubscriptionPanelContentWorkspace.vue +++ b/src/platform/workspace/components/SubscriptionPanelContentWorkspace.vue @@ -534,12 +534,24 @@ const refillsDate = computed(() => { const creditsRemainingLabel = computed(() => isYearlySubscription.value - ? t('subscription.creditsRemainingThisYear', { - date: refillsDate.value - }) - : t('subscription.creditsRemainingThisMonth', { - date: refillsDate.value - }) + ? t( + 'subscription.creditsRemainingThisYear', + { + date: refillsDate.value + }, + { + escapeParameter: false + } + ) + : t( + 'subscription.creditsRemainingThisMonth', + { + date: refillsDate.value + }, + { + escapeParameter: false + } + ) ) const planTotalCredits = computed(() => {