diff --git a/frontend/src/components/maps/LocationMapSetupPanel.jsx b/frontend/src/components/maps/LocationMapSetupPanel.jsx index 30d9f37..721d07c 100644 --- a/frontend/src/components/maps/LocationMapSetupPanel.jsx +++ b/frontend/src/components/maps/LocationMapSetupPanel.jsx @@ -44,12 +44,25 @@ export default function LocationMapSetupPanel({ No zones are available yet. Create a blank map now, or add zones first for an automatic starter layout.

) : null} - - + {!hasZones ? ( + <> + + + + ) : ( + <> + + + + )} ) : null} diff --git a/frontend/tests/location-map-manager.spec.ts b/frontend/tests/location-map-manager.spec.ts index 5a51959..a064ef1 100644 --- a/frontend/tests/location-map-manager.spec.ts +++ b/frontend/tests/location-map-manager.spec.ts @@ -396,6 +396,12 @@ test("admin setup explains when no zones exist yet", async ({ page }) => { await expect(page.getByText("No zones are available yet.")).toBeVisible(); await expect(page.getByRole("button", { name: "Create From Zones" })).toBeDisabled(); await expect(page.getByRole("button", { name: "Create Blank Map" })).toBeEnabled(); + const blankButtonBox = await page.getByRole("button", { name: "Create Blank Map" }).boundingBox(); + const fromZonesButtonBox = await page.getByRole("button", { name: "Create From Zones" }).boundingBox(); + expect(blankButtonBox).not.toBeNull(); + expect(fromZonesButtonBox).not.toBeNull(); + if (!blankButtonBox || !fromZonesButtonBox) throw new Error("No-zone setup actions were not measurable"); + expect(blankButtonBox.y).toBeLessThan(fromZonesButtonBox.y); await expect(page.getByLabel("Map controls")).toHaveCount(0); });