From c66ffa99144474644a2bba979773953723604795 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Bombeck?= Date: Sat, 31 Oct 2026 10:59:23 +0100 Subject: [PATCH] test(e2e): focus the lab reading once the timeline has redrawn it The chart redraws its point targets when the marker's readings arrive; a target focused just before that is replaced and no tip opens. --- e2e/timeline.spec.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/e2e/timeline.spec.ts b/e2e/timeline.spec.ts index 610a063d8..4ade3ce8b 100644 --- a/e2e/timeline.spec.ts +++ b/e2e/timeline.spec.ts @@ -865,9 +865,13 @@ test("a lab marker is picked, drawn as its readings, read on its own and kept", const target = page.locator( '[data-slot="timeline-point-target"][data-series="lab:bm-ferritin"][data-t="fe-1"]', ); - await target.focus(); const tip = page.locator('[data-slot="timeline-point-tip"]'); - await expect(tip).toHaveAttribute("data-t", "fe-1"); + // The chart redraws its targets once the marker's readings arrive, and a + // target focused just before that is gone; focus the one that stays. + await expect(async () => { + await target.focus(); + await expect(tip).toHaveAttribute("data-t", "fe-1", { timeout: 1_000 }); + }).toPass({ timeout: 10_000 }); await expect(tip).toContainText("22 ng/mL"); await expect(tip).toContainText("Laborbefund März");