fix: clarify member map empty state
This commit is contained in:
parent
4c753579dd
commit
635347bea2
@ -15,10 +15,11 @@ export default function LocationMapSetupPanel({
|
|||||||
const createBlankLabel = savingAction === "create-blank" ? "Creating..." : "Create Blank Map";
|
const createBlankLabel = savingAction === "create-blank" ? "Creating..." : "Create Blank Map";
|
||||||
const createZonesButtonLabel = savingAction === "create-zones" ? "Creating..." : createFromZonesLabel;
|
const createZonesButtonLabel = savingAction === "create-zones" ? "Creating..." : createFromZonesLabel;
|
||||||
const publishLabel = savingAction === "publish" ? "Publishing..." : "Publish";
|
const publishLabel = savingAction === "publish" ? "Publishing..." : "Publish";
|
||||||
|
const heading = hasAnyMap ? "Draft Map" : canManage ? "No Map" : "No Published Map";
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<section className="location-map-setup">
|
<section className="location-map-setup">
|
||||||
<h2>{hasAnyMap ? "Draft Map" : "No Map"}</h2>
|
<h2>{heading}</h2>
|
||||||
{canManage ? (
|
{canManage ? (
|
||||||
<div className="location-map-setup-rows" role="group" aria-label="Map setup details">
|
<div className="location-map-setup-rows" role="group" aria-label="Map setup details">
|
||||||
<div className="location-map-setup-row">
|
<div className="location-map-setup-row">
|
||||||
|
|||||||
@ -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 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.getByRole("group", { name: "Map setup details" })).toHaveCount(0);
|
||||||
await expect(page.getByText("Not published")).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);
|
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 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.getByRole("group", { name: "Map setup details" })).toHaveCount(0);
|
||||||
await expect(page.getByText("Not published")).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);
|
await expect(page.getByText("A household admin has not published a map yet.")).toHaveCount(0);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user