From 3fbba7672d9883463e436ded1f7b75fbe37f1810 Mon Sep 17 00:00:00 2001 From: Mischa Date: Fri, 19 Jun 2026 23:17:05 +0200 Subject: [PATCH] =?UTF-8?q?test:=20fix=20M2=20timing=20=E2=80=94=20wait=20?= =?UTF-8?q?for=20first=20marker=20before=20counting?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Markers are added in map.on('load') which fires after the canvas becomes visible; the old check was racy. Add an explicit waitFor so M2 reliably passes with demo data loaded. Co-Authored-By: Claude Sonnet 4.6 Claude-Session: https://claude.ai/code/session_01Vgmzx8VTTTmCskSpQtsLTr --- tests/ui/maps.spec.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/ui/maps.spec.js b/tests/ui/maps.spec.js index 219343c..638b5f9 100644 --- a/tests/ui/maps.spec.js +++ b/tests/ui/maps.spec.js @@ -17,7 +17,8 @@ test('M1: /map page renders MapLibre GL canvas without JS errors', async ({ page test('M2: /map page has at least one dot marker', async ({ page }) => { await page.goto('/trips/japan-korea-2026/map'); await expect(page.locator('canvas.maplibregl-canvas')).toBeVisible({ timeout: 10000 }); - // Custom DOM markers are rendered as .maplibregl-marker elements + // Markers are added in map.on('load') — wait for first to appear in the DOM + await expect(page.locator('.maplibregl-marker').first()).toBeVisible({ timeout: 15000 }); const markerCount = await page.locator('.maplibregl-marker').count(); expect(markerCount, 'At least one marker present').toBeGreaterThan(0); });