From 37a7b79cd855d697d5a1055dd3c607932f7f51bb Mon Sep 17 00:00:00 2001 From: Nico Date: Thu, 4 Jun 2026 13:09:43 -0700 Subject: [PATCH] test: cover unmapped bought map items --- frontend/tests/location-map-manager.spec.ts | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/frontend/tests/location-map-manager.spec.ts b/frontend/tests/location-map-manager.spec.ts index 37edfa6..2ce3da0 100644 --- a/frontend/tests/location-map-manager.spec.ts +++ b/frontend/tests/location-map-manager.spec.ts @@ -2207,7 +2207,7 @@ test("viewer can buy unmapped map items in place", async ({ page }) => { }); await expect(page.locator(".confirm-buy-item-name")).toHaveText("paper plates"); await expect(page.getByText("loose batteries")).toHaveCount(0); - await expect(page.getByLabel("Map summary").locator(".location-map-overview-row", { hasText: "Unmapped" })).toContainText("1"); + await expect(page.getByLabel("Map summary").locator(".location-map-overview-row", { hasText: "Unmapped" })).toContainText("1 shown"); await page.getByRole("button", { name: "Mark as Bought" }).click(); @@ -2219,7 +2219,16 @@ test("viewer can buy unmapped map items in place", async ({ page }) => { }); await expect(page.locator(".confirm-buy-modal")).toHaveCount(0); await expect(page.getByText("paper plates")).toHaveCount(0); - await expect(page.getByLabel("Map summary").locator(".location-map-overview-row", { hasText: "Unmapped" })).toContainText("0"); + await expect(page.getByLabel("Map summary").locator(".location-map-overview-row", { hasText: "Unmapped" })).toContainText("0 shown"); + + await page.getByRole("button", { name: "Bought" }).click(); + await expect(page.getByLabel("Map summary").locator(".location-map-overview-row", { hasText: "Unmapped" })).toContainText("2"); + const looseBatteriesRow = page.getByRole("button", { name: "loose batteries bought" }); + const paperPlatesRow = page.getByRole("button", { name: "paper plates bought" }); + await expect(looseBatteriesRow).toBeVisible(); + await expect(looseBatteriesRow).toBeDisabled(); + await expect(paperPlatesRow).toBeVisible(); + await expect(paperPlatesRow).toBeDisabled(); }); test("viewer hides unrelated unmapped items while a zone is selected", async ({ page }) => {