fix: clarify member map empty state

This commit is contained in:
Nico 2026-06-04 21:05:48 -07:00
parent 4c753579dd
commit 635347bea2
2 changed files with 6 additions and 3 deletions

View File

@ -15,10 +15,11 @@ export default function LocationMapSetupPanel({
const createBlankLabel = savingAction === "create-blank" ? "Creating..." : "Create Blank Map";
const createZonesButtonLabel = savingAction === "create-zones" ? "Creating..." : createFromZonesLabel;
const publishLabel = savingAction === "publish" ? "Publishing..." : "Publish";
const heading = hasAnyMap ? "Draft Map" : canManage ? "No Map" : "No Published Map";
return (
<section className="location-map-setup">
<h2>{hasAnyMap ? "Draft Map" : "No Map"}</h2>
<h2>{heading}</h2>
{canManage ? (
<div className="location-map-setup-rows" role="group" aria-label="Map setup details">
<div className="location-map-setup-row">

View File

@ -4283,7 +4283,8 @@ test("members see a clean empty state when no map is published", async ({ page }
await page.goto("/stores/100/locations/10/map");
await expect(page.getByRole("heading", { name: "No Map" })).toBeVisible();
await expect(page.getByRole("heading", { name: "No Published Map" })).toBeVisible();
await expect(page.getByRole("heading", { name: "No Map" })).toHaveCount(0);
await expect(page.getByRole("group", { name: "Map setup details" })).toHaveCount(0);
await expect(page.getByText("Not published")).toHaveCount(0);
await expect(page.getByText("A household admin has not published a map yet.")).toHaveCount(0);
@ -4325,7 +4326,8 @@ test("members do not see unpublished draft maps", async ({ page }) => {
await page.goto("/stores/100/locations/10/map");
await expect(page.getByRole("heading", { name: "No Map" })).toBeVisible();
await expect(page.getByRole("heading", { name: "No Published Map" })).toBeVisible();
await expect(page.getByRole("heading", { name: "No Map" })).toHaveCount(0);
await expect(page.getByRole("group", { name: "Map setup details" })).toHaveCount(0);
await expect(page.getByText("Not published")).toHaveCount(0);
await expect(page.getByText("A household admin has not published a map yet.")).toHaveCount(0);