Add store location map manager #20
@ -23,7 +23,7 @@ export default function LocationMapSetupPanel({
|
||||
: "Create From Zones";
|
||||
const createBlankLabel = savingAction === "create-blank" ? "Creating..." : "Create Blank Map";
|
||||
const createZonesButtonLabel = savingAction === "create-zones" ? "Creating..." : createFromZonesLabel;
|
||||
const publishLabel = savingAction === "publish" ? "Publishing..." : "Publish Map";
|
||||
const publishLabel = savingAction === "publish" ? "Publishing..." : "Publish";
|
||||
|
||||
return (
|
||||
<section className="location-map-setup">
|
||||
@ -35,7 +35,7 @@ export default function LocationMapSetupPanel({
|
||||
Continue Editing
|
||||
</button>
|
||||
<button type="button" className="btn-secondary" onClick={onPreview} disabled={saving}>
|
||||
Preview Map
|
||||
Preview Draft
|
||||
</button>
|
||||
<button type="button" className="btn-primary" onClick={onPublish} disabled={saving || !canManage}>
|
||||
{publishLabel}
|
||||
|
||||
@ -354,6 +354,10 @@ test("admin creates a map from zones, saves a draft, and publishes it", async ({
|
||||
await page.goto("/stores/100/locations/10/map");
|
||||
await expect(page.locator(".location-map-status")).toHaveText("Draft");
|
||||
await expect(page.getByRole("heading", { name: "Draft Map" })).toBeVisible();
|
||||
await expect(page.getByRole("button", { name: "Preview Draft" })).toBeVisible();
|
||||
await expect(page.getByRole("button", { name: "Publish", exact: true })).toBeVisible();
|
||||
await expect(page.getByRole("button", { name: "Preview Map" })).toHaveCount(0);
|
||||
await expect(page.getByRole("button", { name: "Publish Map" })).toHaveCount(0);
|
||||
await page.getByRole("button", { name: "Continue Editing" }).click();
|
||||
await expect(page.locator(".location-map-object", { hasText: "Bread Wall" })).toBeVisible();
|
||||
await expect(page.locator(".location-map-object", { hasText: "Temporary Freezer" })).toHaveCount(0);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user