|
|
|
|
@ -1409,7 +1409,6 @@ test("mobile keeps viewing draft 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();
|
|
|
|
|
@ -1418,7 +1417,6 @@ test("mobile keeps viewing draft 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 ||
|
|
|
|
|
@ -1428,7 +1426,6 @@ test("mobile keeps viewing draft status compact in the topbar", async ({ page })
|
|
|
|
|
!toolbarBox ||
|
|
|
|
|
!modeGroupBox ||
|
|
|
|
|
!modeBox ||
|
|
|
|
|
!reservedHistoryBox ||
|
|
|
|
|
!zoomBox
|
|
|
|
|
) {
|
|
|
|
|
throw new Error("Mobile map controls layout was not measurable");
|
|
|
|
|
@ -1440,19 +1437,15 @@ test("mobile keeps viewing draft status compact in the topbar", async ({ page })
|
|
|
|
|
expect(statusBox.y).toBeLessThan(titleBox.y + titleBox.height);
|
|
|
|
|
expect(statusBox.x).toBeGreaterThan(titleBox.x);
|
|
|
|
|
expect(toolbarBox.height).toBeLessThanOrEqual(64);
|
|
|
|
|
expect(modeBox.width).toBeGreaterThanOrEqual(130);
|
|
|
|
|
expect(modeBox.width).toBeLessThanOrEqual(136);
|
|
|
|
|
expect(reservedHistoryBox.width).toBeGreaterThanOrEqual(82);
|
|
|
|
|
expect(reservedHistoryBox.x).toBeGreaterThan(modeBox.x + modeBox.width - 1);
|
|
|
|
|
await expect(historyActions).toHaveCSS("visibility", "hidden");
|
|
|
|
|
await expect(historyActions.locator('button[aria-label="Undo"]')).toBeDisabled();
|
|
|
|
|
await expect(historyActions.locator('button[aria-label="Redo"]')).toBeDisabled();
|
|
|
|
|
expect(modeBox.width).toBeGreaterThanOrEqual(166);
|
|
|
|
|
expect(modeBox.width).toBeLessThanOrEqual(172);
|
|
|
|
|
await expect(historyActions).toHaveCount(0);
|
|
|
|
|
expect(zoomBox.y).toBeLessThan(modeBox.y + modeBox.height);
|
|
|
|
|
expect(zoomBox.x).toBeGreaterThan(reservedHistoryBox.x + reservedHistoryBox.width - 1);
|
|
|
|
|
expect(zoomBox.x).toBeGreaterThan(modeBox.x + modeBox.width - 1);
|
|
|
|
|
expect(zoomBox.x + zoomBox.width).toBeLessThanOrEqual(toolbarBox.x + toolbarBox.width + 1);
|
|
|
|
|
|
|
|
|
|
await page.getByRole("button", { name: "Edit Draft" }).click();
|
|
|
|
|
await expect(historyActions).toHaveCSS("visibility", "visible");
|
|
|
|
|
await expect(historyActions).toHaveCount(1);
|
|
|
|
|
await expect(historyActions.getByRole("button", { name: "Undo" })).toBeVisible();
|
|
|
|
|
await expect(historyActions.getByRole("button", { name: "Redo" })).toBeVisible();
|
|
|
|
|
const editToolbarBox = await toolbar.boundingBox();
|
|
|
|
|
@ -1471,11 +1464,13 @@ test("mobile keeps viewing draft 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(editModeBox.width).toBeGreaterThanOrEqual(130);
|
|
|
|
|
expect(editModeBox.width).toBeLessThanOrEqual(136);
|
|
|
|
|
expect(Math.abs(editHistoryBox.width - reservedHistoryBox.width)).toBeLessThanOrEqual(1);
|
|
|
|
|
expect(editModeBox.width).toBeGreaterThanOrEqual(166);
|
|
|
|
|
expect(editModeBox.width).toBeLessThanOrEqual(172);
|
|
|
|
|
expect(editHistoryBox.width).toBeGreaterThanOrEqual(82);
|
|
|
|
|
expect(editHistoryBox.x).toBeGreaterThan(editModeBox.x + editModeBox.width);
|
|
|
|
|
expect(editZoomBox.x).toBeGreaterThan(editHistoryBox.x + editHistoryBox.width);
|
|
|
|
|
expect(editHistoryBox.x + editHistoryBox.width).toBeLessThanOrEqual(editToolbarBox.x + editToolbarBox.width + 1);
|
|
|
|
|
expect(editZoomBox.y).toBeGreaterThan(editModeBox.y + editModeBox.height - 1);
|
|
|
|
|
expect(editZoomBox.x).toBeGreaterThanOrEqual(editToolbarBox.x);
|
|
|
|
|
expect(editZoomBox.x + editZoomBox.width).toBeLessThanOrEqual(editToolbarBox.x + editToolbarBox.width + 1);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
@ -1531,8 +1526,8 @@ test("narrow mobile toolbar keeps map controls tappable without overflow", async
|
|
|
|
|
|
|
|
|
|
expect(toolbarBox.x).toBeGreaterThanOrEqual(0);
|
|
|
|
|
expect(toolbarBox.x + toolbarBox.width).toBeLessThanOrEqual(361);
|
|
|
|
|
expect(modeBox.width).toBeGreaterThanOrEqual(130);
|
|
|
|
|
expect(modeBox.width).toBeLessThanOrEqual(136);
|
|
|
|
|
expect(modeBox.width).toBeGreaterThanOrEqual(166);
|
|
|
|
|
expect(modeBox.width).toBeLessThanOrEqual(172);
|
|
|
|
|
expect(modeBox.x + modeBox.width).toBeLessThanOrEqual(historyBox.x);
|
|
|
|
|
expect(zoomBox.y).toBeGreaterThan(modeBox.y + modeBox.height - 1);
|
|
|
|
|
expect(zoomBox.x).toBeGreaterThanOrEqual(toolbarBox.x);
|
|
|
|
|
@ -2708,11 +2703,14 @@ test("viewer wraps long zone labels and keeps item counts visible", async ({ pag
|
|
|
|
|
|
|
|
|
|
await page.getByRole("button", { name: "Layers" }).click();
|
|
|
|
|
const labelsToggle = page.getByRole("button", { name: "Labels" });
|
|
|
|
|
await expect(page.locator(".location-map-display-controls .location-map-layer-state")).toHaveCount(8);
|
|
|
|
|
await expect(labelsToggle).toHaveAttribute("aria-pressed", "true");
|
|
|
|
|
await expect(labelsToggle.locator(".location-map-layer-state.is-on")).toHaveCount(1);
|
|
|
|
|
await expect(page.getByRole("button", { name: "Bought" })).toBeVisible();
|
|
|
|
|
await expect(page.getByRole("button", { name: "Done" })).toHaveCount(0);
|
|
|
|
|
await labelsToggle.click();
|
|
|
|
|
await expect(labelsToggle).toHaveAttribute("aria-pressed", "false");
|
|
|
|
|
await expect(labelsToggle.locator(".location-map-layer-state.is-on")).toHaveCount(0);
|
|
|
|
|
await expect(page.getByRole("button", { name: "Layers, 1 changed" })).toBeVisible();
|
|
|
|
|
await expect(produceArea.locator(".location-map-label")).toHaveCount(0);
|
|
|
|
|
await expect(produceArea.locator(".location-map-count")).toHaveText("2 items");
|
|
|
|
|
@ -3926,22 +3924,19 @@ test("compact tablet map starts fitted on first load", async ({ page }) => {
|
|
|
|
|
const historyActions = page.locator(".location-map-history-buttons");
|
|
|
|
|
const zoomControls = page.locator(".location-map-zoom-controls");
|
|
|
|
|
const viewModeBox = await modeButtons.boundingBox();
|
|
|
|
|
const reservedHistoryBox = await historyActions.boundingBox();
|
|
|
|
|
const viewZoomBox = await zoomControls.boundingBox();
|
|
|
|
|
expect(viewModeBox).not.toBeNull();
|
|
|
|
|
expect(reservedHistoryBox).not.toBeNull();
|
|
|
|
|
expect(viewZoomBox).not.toBeNull();
|
|
|
|
|
if (!viewModeBox || !reservedHistoryBox || !viewZoomBox) {
|
|
|
|
|
if (!viewModeBox || !viewZoomBox) {
|
|
|
|
|
throw new Error("Compact tablet toolbar layout was not measurable");
|
|
|
|
|
}
|
|
|
|
|
expect(viewModeBox.width).toBeGreaterThanOrEqual(180);
|
|
|
|
|
expect(viewModeBox.width).toBeLessThanOrEqual(190);
|
|
|
|
|
await expect(historyActions).toHaveCSS("visibility", "hidden");
|
|
|
|
|
expect(reservedHistoryBox.x).toBeGreaterThan(viewModeBox.x + viewModeBox.width - 1);
|
|
|
|
|
expect(viewZoomBox.x).toBeGreaterThan(reservedHistoryBox.x + reservedHistoryBox.width - 1);
|
|
|
|
|
await expect(historyActions).toHaveCount(0);
|
|
|
|
|
expect(viewZoomBox.x).toBeGreaterThan(viewModeBox.x + viewModeBox.width - 1);
|
|
|
|
|
|
|
|
|
|
await page.getByRole("button", { name: "Edit Draft" }).click();
|
|
|
|
|
await expect(historyActions).toHaveCSS("visibility", "visible");
|
|
|
|
|
await expect(historyActions).toHaveCount(1);
|
|
|
|
|
const toolbarBox = await toolbar.boundingBox();
|
|
|
|
|
const editModeBox = await modeButtons.boundingBox();
|
|
|
|
|
const editHistoryBox = await historyActions.boundingBox();
|
|
|
|
|
@ -4288,7 +4283,8 @@ test("members see a clean empty state when no map is published", async ({ page }
|
|
|
|
|
|
|
|
|
|
await page.goto("/stores/100/locations/10/map");
|
|
|
|
|
|
|
|
|
|
await expect(page.getByRole("heading", { name: "No Map" })).toBeVisible();
|
|
|
|
|
await expect(page.getByRole("heading", { name: "No Published Map" })).toBeVisible();
|
|
|
|
|
await expect(page.getByRole("heading", { name: "No Map" })).toHaveCount(0);
|
|
|
|
|
await expect(page.getByRole("group", { name: "Map setup details" })).toHaveCount(0);
|
|
|
|
|
await expect(page.getByText("Not published")).toHaveCount(0);
|
|
|
|
|
await expect(page.getByText("A household admin has not published a map yet.")).toHaveCount(0);
|
|
|
|
|
@ -4330,7 +4326,8 @@ test("members do not see unpublished draft maps", async ({ page }) => {
|
|
|
|
|
|
|
|
|
|
await page.goto("/stores/100/locations/10/map");
|
|
|
|
|
|
|
|
|
|
await expect(page.getByRole("heading", { name: "No Map" })).toBeVisible();
|
|
|
|
|
await expect(page.getByRole("heading", { name: "No Published Map" })).toBeVisible();
|
|
|
|
|
await expect(page.getByRole("heading", { name: "No Map" })).toHaveCount(0);
|
|
|
|
|
await expect(page.getByRole("group", { name: "Map setup details" })).toHaveCount(0);
|
|
|
|
|
await expect(page.getByText("Not published")).toHaveCount(0);
|
|
|
|
|
await expect(page.getByText("A household admin has not published a map yet.")).toHaveCount(0);
|
|
|
|
|
|