diff --git a/apps/desktop/src/app/settings/billing/index.test.tsx b/apps/desktop/src/app/settings/billing/index.test.tsx
index 12d408d8cc5f..7052e111d251 100644
--- a/apps/desktop/src/app/settings/billing/index.test.tsx
+++ b/apps/desktop/src/app/settings/billing/index.test.tsx
@@ -304,18 +304,14 @@ describe('BillingSettings', () => {
fireEvent.click(await screen.findByRole('button', { name: 'Downgrade' }))
- await waitFor(() =>
- expect(apiMocks.previewSubscriptionChange).toHaveBeenCalledWith('cltier000free0000personal')
- )
+ await waitFor(() => expect(apiMocks.previewSubscriptionChange).toHaveBeenCalledWith('cltier000free0000personal'))
expect(await screen.findByText(/No charge now/)).toBeTruthy()
// Credits delta renders as signed dollars, not the raw wire string "-88".
expect(screen.getByText(/Monthly credits change: −\$88\/mo\./)).toBeTruthy()
fireEvent.click(screen.getByRole('button', { name: 'Confirm downgrade' }))
- await waitFor(() =>
- expect(apiMocks.scheduleSubscriptionChange).toHaveBeenCalledWith('cltier000free0000personal')
- )
+ await waitFor(() => expect(apiMocks.scheduleSubscriptionChange).toHaveBeenCalledWith('cltier000free0000personal'))
await waitFor(() => expect(invalidate).toHaveBeenCalledWith({ queryKey: ['billing', 'subscription'] }))
// Scheduled → back on the overview.
expect(await screen.findByText('Payment')).toBeTruthy()
@@ -392,10 +388,42 @@ describe('BillingSettings', () => {
context: 'personal',
current: { ...todaySubscriptionState.current, tier_id: 't_ultra', tier_name: 'Ultra' },
tiers: [
- { dollars_per_month_display: '$0', is_current: false, is_enabled: true, monthly_credits: '0.1', name: 'Free', tier_id: 't_free', tier_order: 0 },
- { dollars_per_month_display: '$20', is_current: false, is_enabled: true, monthly_credits: '22', name: 'Plus', tier_id: 't_plus', tier_order: 1 },
- { dollars_per_month_display: '$100', is_current: false, is_enabled: true, monthly_credits: '110', name: 'Super', tier_id: 't_super', tier_order: 2 },
- { dollars_per_month_display: '$200', is_current: true, is_enabled: true, monthly_credits: '220', name: 'Ultra', tier_id: 't_ultra', tier_order: 3 }
+ {
+ dollars_per_month_display: '$0',
+ is_current: false,
+ is_enabled: true,
+ monthly_credits: '0.1',
+ name: 'Free',
+ tier_id: 't_free',
+ tier_order: 0
+ },
+ {
+ dollars_per_month_display: '$20',
+ is_current: false,
+ is_enabled: true,
+ monthly_credits: '22',
+ name: 'Plus',
+ tier_id: 't_plus',
+ tier_order: 1
+ },
+ {
+ dollars_per_month_display: '$100',
+ is_current: false,
+ is_enabled: true,
+ monthly_credits: '110',
+ name: 'Super',
+ tier_id: 't_super',
+ tier_order: 2
+ },
+ {
+ dollars_per_month_display: '$200',
+ is_current: true,
+ is_enabled: true,
+ monthly_credits: '220',
+ name: 'Ultra',
+ tier_id: 't_ultra',
+ tier_order: 3
+ }
]
})
)
diff --git a/apps/desktop/src/app/settings/billing/plans-view.tsx b/apps/desktop/src/app/settings/billing/plans-view.tsx
index 9911ca720859..440d43b6869e 100644
--- a/apps/desktop/src/app/settings/billing/plans-view.tsx
+++ b/apps/desktop/src/app/settings/billing/plans-view.tsx
@@ -95,7 +95,11 @@ function DowngradeConfirm({ flow, tier }: { flow: DowngradeFlow; tier: BillingPl
) : canConfirm ? (
void flow.confirm()} size="sm" type="button">
- {phase.kind === 'scheduling' ? 'Scheduling…' : phase.kind === 'scheduleFailed' ? 'Try again' : 'Confirm downgrade'}
+ {phase.kind === 'scheduling'
+ ? 'Scheduling…'
+ : phase.kind === 'scheduleFailed'
+ ? 'Try again'
+ : 'Confirm downgrade'}
) : null}
@@ -155,7 +159,12 @@ function PlanCard({ flow, tier }: { flow: DowngradeFlow; tier: BillingPlanTierVi
{tier.state === 'scheduled' && Scheduled}
{tier.state === 'upgrade' && (
- tier.action && openExternalLink(tier.action.url)} size="sm" type="button" variant="outline">
+ tier.action && openExternalLink(tier.action.url)}
+ size="sm"
+ type="button"
+ variant="outline"
+ >
{tier.action.label}
diff --git a/apps/desktop/src/app/settings/billing/simulated-api.ts b/apps/desktop/src/app/settings/billing/simulated-api.ts
index 4a099cd1f20e..a03ac3217466 100644
--- a/apps/desktop/src/app/settings/billing/simulated-api.ts
+++ b/apps/desktop/src/app/settings/billing/simulated-api.ts
@@ -1,9 +1,5 @@
import type { BillingApi, BillingResult } from './api'
-import type {
- BillingStateResponse,
- SubscriptionPreviewResponse,
- SubscriptionStateResponse
-} from './types'
+import type { BillingStateResponse, SubscriptionPreviewResponse, SubscriptionStateResponse } from './types'
/** The shape of one `billingDevFixtures` entry — a canned billing + subscription pair. */
export interface SimulatedFixture {
diff --git a/apps/desktop/src/app/settings/billing/use-billing-state.ts b/apps/desktop/src/app/settings/billing/use-billing-state.ts
index 9af792f816cc..da02f441ebe0 100644
--- a/apps/desktop/src/app/settings/billing/use-billing-state.ts
+++ b/apps/desktop/src/app/settings/billing/use-billing-state.ts
@@ -5,12 +5,7 @@ import { fmtDate } from '@/lib/time'
import type { BillingRefusal, BillingResult } from './api'
import { useBillingApi } from './api'
import { resolveRefusal } from './errors'
-import type {
- BillingStateResponse,
- SubscriptionStateResponse,
- SubscriptionTierOption,
- UsageModelData
-} from './types'
+import type { BillingStateResponse, SubscriptionStateResponse, SubscriptionTierOption, UsageModelData } from './types'
export const EMPTY_BILLING_VALUE = '—'
export const FALLBACK_PORTAL_BILLING_URL = 'https://portal.nousresearch.com/billing'