diff --git a/app/components/BillingCreditsViewer.vue b/app/components/BillingCreditsViewer.vue index 2bdb783d..63c8c242 100644 --- a/app/components/BillingCreditsViewer.vue +++ b/app/components/BillingCreditsViewer.vue @@ -257,9 +257,14 @@
- - No per-user CLI token usage available — load the User Metrics tab - once so token data is fetched, then revisit. + + No CLI token usage was reported for any user in this period. diff --git a/tests/billing-credits-top-token-empty-state.spec.ts b/tests/billing-credits-top-token-empty-state.spec.ts new file mode 100644 index 00000000..4acde038 --- /dev/null +++ b/tests/billing-credits-top-token-empty-state.spec.ts @@ -0,0 +1,16 @@ +// @vitest-environment node +import { describe, expect, test } from 'vitest'; +import { readFileSync } from 'node:fs'; + +const componentSource = readFileSync( + new URL('../app/components/BillingCreditsViewer.vue', import.meta.url), + 'utf8' +); + +describe('BillingCreditsViewer Top token users empty state', () => { + test('uses accurate guidance when no CLI token usage is reported', () => { + expect(componentSource).toContain('data-testid="billing-top-token-users-empty-state"'); + expect(componentSource).toContain('No CLI token usage was reported for any user in this period.'); + expect(componentSource).not.toContain('load the User Metrics tab'); + }); +});