Add store location map manager #20

Open
nalalangan wants to merge 206 commits from feature/location-map-manager into feature/store-selector-modal
2 changed files with 18 additions and 3 deletions
Showing only changes of commit 97a502362d - Show all commits

View File

@ -181,7 +181,8 @@
}
.location-map-history-buttons.is-reserved {
display: none;
visibility: hidden;
pointer-events: none;
}
.location-map-history-buttons button {

View File

@ -745,6 +745,7 @@ test("mobile keeps draft preview status compact in the topbar", async ({ page })
const toolbar = page.locator(".location-map-toolbar");
const modeGroup = page.locator(".location-map-mode-group");
const modeButtons = page.locator(".location-map-mode-buttons");
const historyActions = page.locator(".location-map-history-buttons");
const zoomControls = page.locator(".location-map-zoom-controls");
await expect(status).toHaveText("Draft Preview");
@ -755,6 +756,7 @@ test("mobile keeps draft preview status compact in the topbar", async ({ page })
const toolbarBox = await toolbar.boundingBox();
const modeGroupBox = await modeGroup.boundingBox();
const modeBox = await modeButtons.boundingBox();
const reservedHistoryBox = await historyActions.boundingBox();
const zoomBox = await zoomControls.boundingBox();
expect(topbarBox).not.toBeNull();
expect(backButtonBox).not.toBeNull();
@ -763,8 +765,19 @@ test("mobile keeps draft preview status compact in the topbar", async ({ page })
expect(toolbarBox).not.toBeNull();
expect(modeGroupBox).not.toBeNull();
expect(modeBox).not.toBeNull();
expect(reservedHistoryBox).not.toBeNull();
expect(zoomBox).not.toBeNull();
if (!topbarBox || !backButtonBox || !titleBox || !statusBox || !toolbarBox || !modeGroupBox || !modeBox || !zoomBox) {
if (
!topbarBox ||
!backButtonBox ||
!titleBox ||
!statusBox ||
!toolbarBox ||
!modeGroupBox ||
!modeBox ||
!reservedHistoryBox ||
!zoomBox
) {
throw new Error("Mobile map controls layout was not measurable");
}
expect(topbarBox.height).toBeLessThanOrEqual(66);
@ -773,11 +786,11 @@ test("mobile keeps draft preview status compact in the topbar", async ({ page })
expect(statusBox.x).toBeGreaterThan(titleBox.x);
expect(toolbarBox.height).toBeLessThanOrEqual(64);
expect(modeBox.width).toBeLessThanOrEqual(150);
expect(reservedHistoryBox.width).toBeGreaterThanOrEqual(70);
expect(zoomBox.y).toBeLessThan(modeBox.y + modeBox.height);
expect(zoomBox.x + zoomBox.width).toBeLessThanOrEqual(toolbarBox.x + toolbarBox.width + 1);
await page.getByRole("button", { name: "Edit Draft" }).click();
const historyActions = page.locator(".location-map-history-buttons");
await expect(historyActions.getByRole("button", { name: "Undo" })).toBeVisible();
await expect(historyActions.getByRole("button", { name: "Redo" })).toBeVisible();
const editToolbarBox = await toolbar.boundingBox();
@ -796,6 +809,7 @@ test("mobile keeps draft preview status compact in the topbar", async ({ page })
expect(Math.abs(editModeBox.x - modeBox.x)).toBeLessThanOrEqual(1);
expect(Math.abs(editModeGroupBox.width - modeGroupBox.width)).toBeLessThanOrEqual(1);
expect(Math.abs(editModeBox.width - modeBox.width)).toBeLessThanOrEqual(1);
expect(Math.abs(editHistoryBox.width - reservedHistoryBox.width)).toBeLessThanOrEqual(1);
expect(editHistoryBox.x).toBeGreaterThan(editModeBox.x + editModeBox.width);
expect(editZoomBox.x).toBeGreaterThan(editHistoryBox.x + editHistoryBox.width);
expect(editZoomBox.x + editZoomBox.width).toBeLessThanOrEqual(editToolbarBox.x + editToolbarBox.width + 1);