fix: compact map confirmation dialogs

This commit is contained in:
Nico 2026-06-17 00:49:02 -07:00
parent c9fbbafe58
commit 0580914516
2 changed files with 2 additions and 2 deletions

View File

@ -30,7 +30,6 @@ export default function LocationMapDialogs({
<ConfirmSlideModal
isOpen={Boolean(pendingDeleteObject)}
title={`Delete ${getMapObjectDisplayLabel(pendingDeleteObject, "this map area")}?`}
description="This removes the area from the draft map. Save the draft after deleting to keep the change."
confirmLabel="Delete Area"
onClose={onDeleteClose}
onConfirm={onDeleteConfirm}
@ -38,7 +37,6 @@ export default function LocationMapDialogs({
<ConfirmSlideModal
isOpen={Boolean(pendingLeaveTarget)}
title="Leave with unsaved changes?"
description="Your draft edits are only on this screen right now. Save the draft before leaving if you want to keep them."
confirmLabel="Leave Map"
onClose={onLeaveClose}
onConfirm={onLeaveConfirm}

View File

@ -363,11 +363,13 @@ test("admin creates a map from zones, saves a draft, and publishes it", async ({
await page.getByLabel("Linked zone").selectOption("502");
await page.getByRole("textbox", { name: "Label" }).fill("Temporary Freezer");
await page.getByRole("button", { name: "Delete area Temporary Freezer" }).click();
await expect(page.getByText("This removes the area from the draft map.")).toHaveCount(0);
await confirmSlide(page);
await expect(page.locator(".location-map-object", { hasText: "Temporary Freezer" })).toHaveCount(0);
await page.getByRole("button", { name: "Back to grocery list" }).click();
await expect(page.getByRole("heading", { name: "Leave with unsaved changes?" })).toBeVisible();
await expect(page.getByText("Your draft edits are only on this screen right now.")).toHaveCount(0);
await page.getByRole("button", { name: "Cancel" }).click();
await expect(page).toHaveURL(/\/stores\/100\/locations\/10\/map$/);