Add store location map manager #20
@ -121,7 +121,7 @@ export default function useLocationMapDraftActions({
|
|||||||
|
|
||||||
const response = await publishLocationMapDraft(activeHouseholdId, locationId);
|
const response = await publishLocationMapDraft(activeHouseholdId, locationId);
|
||||||
if (!isCurrentScope()) return;
|
if (!isCurrentScope()) return;
|
||||||
applyDraftResponse(response, "view", false);
|
applyDraftResponse(response, "view", false, { preserveSelectedIndex: selectedObjectIndex });
|
||||||
toast.success(
|
toast.success(
|
||||||
"Published map",
|
"Published map",
|
||||||
hasUnsavedChanges
|
hasUnsavedChanges
|
||||||
|
|||||||
@ -2795,6 +2795,9 @@ test("admin publish saves pending map edits before publishing", async ({ page })
|
|||||||
await expect(page.locator(".location-map-status")).toHaveText("Published");
|
await expect(page.locator(".location-map-status")).toHaveText("Published");
|
||||||
await expect(page.getByRole("button", { name: "Map area Quick Publish Bakery" })).toBeVisible();
|
await expect(page.getByRole("button", { name: "Map area Quick Publish Bakery" })).toBeVisible();
|
||||||
await expect(page.getByRole("button", { name: "Map area Live Bakery" })).toHaveCount(0);
|
await expect(page.getByRole("button", { name: "Map area Live Bakery" })).toHaveCount(0);
|
||||||
|
await expect(page.locator(".location-map-object.is-selected")).toHaveAttribute("data-object-key", "1450");
|
||||||
|
await expect(page.locator(".location-map-sheet-header strong")).toHaveText("Quick Publish Bakery");
|
||||||
|
await expect(page.getByRole("button", { name: "Close selected map area" })).toBeVisible();
|
||||||
});
|
});
|
||||||
|
|
||||||
test("admin publish failure keeps successfully saved pending edits", async ({ page }) => {
|
test("admin publish failure keeps successfully saved pending edits", async ({ page }) => {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user