feat: Plus und Minus Zoom Icons
This commit is contained in:
@@ -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);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user