diff --git a/clients/dashboard/src/pages/overview.tsx b/clients/dashboard/src/pages/overview.tsx index 6ad00991d7..f1a1b1d241 100644 --- a/clients/dashboard/src/pages/overview.tsx +++ b/clients/dashboard/src/pages/overview.tsx @@ -1046,7 +1046,9 @@ export function OverviewPage() { const firstName = (user?.name ?? user?.email?.split("@")[0] ?? "operator") .toString() .split(" ")[0]; - const tenantLabel = user?.tenant ?? "your tenant"; + // The JWT `tenant` claim is the identifier; the display name comes from the + // status query, so the id only shows while that is unavailable. + const tenantLabel = status.data?.name ?? user?.tenant ?? "your tenant"; // ── Stat values ─────────────────────────────────────────────────────── const planValue = subscription.isLoading ? ( diff --git a/clients/dashboard/tests/overview/overview.spec.ts b/clients/dashboard/tests/overview/overview.spec.ts index a0120b0ee6..eae5827e79 100644 --- a/clients/dashboard/tests/overview/overview.spec.ts +++ b/clients/dashboard/tests/overview/overview.spec.ts @@ -153,6 +153,15 @@ test.describe("overview (/)", () => { } }); + test("first-run panel welcomes the tenant by its name, not its identifier", async ({ page }) => { + // No subscription → first-run panel. The shell mock's status says tenant + // "acme" is named "Acme Corp"; the JWT only carries the identifier. + await mockJsonResponse(page, "**/api/v1/billing/subscriptions/me**", null); + await page.goto("/"); + await expect(page.getByRole("heading", { name: "Welcome to Acme Corp" })).toBeVisible(); + await expect(page.getByRole("heading", { name: "Welcome to acme", exact: true })).toHaveCount(0); + }); + test("Valid-for card reflects an in-grace tenant", async ({ page }) => { await mockJsonResponse(page, "**/api/v1/tenants/me/status**", { id: "acme",