diff --git a/tests/ui/maps.spec.js b/tests/ui/maps.spec.js index accfb25..4425690 100644 --- a/tests/ui/maps.spec.js +++ b/tests/ui/maps.spec.js @@ -86,6 +86,14 @@ test('M7: clicking map marker briefly highlights the corresponding entry card', await expect(page.locator('#trip-map canvas.maplibregl-canvas')).toBeVisible({ timeout: 10000 }); await expect(page.locator('.maplibregl-marker').first()).toBeVisible({ timeout: 15000 }); + // Wait for tripMap to finish animating (fitBounds animation completes) + await page.waitForFunction(function () { + return window.tripMap && + !window.tripMap.isMoving() && + !window.tripMap.isZooming() && + !window.tripMap.isRotating(); + }, { timeout: 15000 }); + // Click the first marker await page.locator('.maplibregl-marker').first().click();