Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion clients/dashboard/src/pages/overview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 ? (
Expand Down
9 changes: 9 additions & 0 deletions clients/dashboard/tests/overview/overview.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
Loading