feat: Plus und Minus Zoom Icons

This commit is contained in:
ISA
2025-09-16 12:12:31 +02:00
parent 051dd4c306
commit 31c770f778
14 changed files with 192 additions and 31 deletions

View File

@@ -268,3 +268,35 @@ test("mouse wheel zoom updates mapZoom", async ({ page }) => {
const afterOut = await getZoomFromLocalStorage(page);
expect(afterOut).toBeLessThan(afterIn);
});
test("zoom control buttons update mapZoom", async ({ page }) => {
await page.addInitScript(() => {
localStorage.setItem("currentMapId", "12");
localStorage.setItem("currentUserId", "484");
localStorage.setItem("mapCenter", JSON.stringify([53.23938294961826, 8.21434020996094]));
localStorage.setItem("mapZoom", "10");
localStorage.setItem("showAppInfoCard", "false");
localStorage.setItem("showCoordinateInput", "false");
localStorage.setItem("showLayersPanel", "false");
localStorage.setItem("showAreaDropdown", "false");
});
await page.goto("http://localhost:3000/?m=12&u=484");
// Wait for Leaflet map and zoom controls
await page.locator("#map.leaflet-container").waitFor({ state: "visible", timeout: 20_000 });
const zoomInBtn = page.locator(".leaflet-control-zoom-in");
const zoomOutBtn = page.locator(".leaflet-control-zoom-out");
await expect(zoomInBtn).toBeVisible();
await expect(zoomOutBtn).toBeVisible();
const z0 = await getZoomFromLocalStorage(page);
await zoomInBtn.click();
await waitForZoomChange(page, z0, "gt");
const z1 = await getZoomFromLocalStorage(page);
expect(z1).toBeGreaterThan(z0);
await zoomOutBtn.click();
await waitForZoomChange(page, z1, "lt");
const z2 = await getZoomFromLocalStorage(page);
expect(z2).toBeLessThan(z1);
});