test: cover draft map persistence

This commit is contained in:
Nico 2026-06-03 11:11:05 -07:00
parent 66e5c41563
commit 6cddc1f95a

View File

@ -305,6 +305,16 @@ test("admin creates a map from zones, saves a draft, and publishes it", async ({
expect(Number(savedBreadWall?.height)).toBeGreaterThan(180);
expect(savedObjects.some((object) => object.label === "Temporary Freezer")).toBe(false);
await page.goto("/login");
await expect(page.getByRole("heading", { name: "Login" })).toBeVisible();
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 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);
await page.getByRole("button", { name: "Publish" }).click();
await expect(page.locator(".location-map-status")).toHaveText("Published");
await expect(page.getByRole("button", { name: "Edit Map" })).toBeVisible();