fix(cloud): ENTITLEMENTS-D plan-unavailable body stays muted (design-squad); feature-copy test uses the real translator

This commit is contained in:
Neil
2026-11-12 01:48:35 -08:00
parent 667ba806f5
commit 515648411f
2 changed files with 5 additions and 5 deletions
@@ -256,7 +256,10 @@ export function CheckoutPanel(props: CheckoutPanelProps): React.JSX.Element {
id={bodyId}
className={cn(
'max-w-sm text-sm text-pretty',
phase.kind === 'open-failed' ? 'text-destructive' : 'text-muted-foreground'
// Unavailable is not the buyer's error: the title and icon carry it, the body stays muted.
phase.kind === 'open-failed' && phase.result.status !== 'plan-unavailable'
? 'text-destructive'
: 'text-muted-foreground'
)}
>
{body}
@@ -1,10 +1,7 @@
import { describe, expect, it } from 'vitest'
import { translate as t } from '@/i18n/i18n'
import { planFeatureLine, planFeatureLines } from './plan-feature-copy'
// The default-value translator the renderer falls back to (interpolates {{name}}).
const t = ((_key: string, fallback: string, values?: Record<string, unknown>) =>
fallback.replace(/\{\{(\w+)\}\}/g, (_, name: string) => String(values?.[name] ?? ''))) as never
const context = { overage: { centsPerHour: 100, defaultSpendCapCents: 2500 }, currency: 'usd' }
describe('plan feature copy', () => {