From ddd1b271dda08f68f7ea7e145d1bef894577158f Mon Sep 17 00:00:00 2001 From: Shinuwa Date: Wed, 18 Nov 2026 19:49:50 +0100 Subject: [PATCH] Wait for the token editor to take focus before typing a child formula in the calculator e2e test Adding a child calculation swaps the expression input for the token editor, which takes focus on the next frame. On a slow CI runner the formula could be typed before that swap and get lost, leaving no result ("-" instead of 60). Co-Authored-By: Claude Opus 5.5 --- e2e/calculator.spec.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/e2e/calculator.spec.js b/e2e/calculator.spec.js index 4dd6c64..f7cc393 100644 --- a/e2e/calculator.spec.js +++ b/e2e/calculator.spec.js @@ -94,7 +94,12 @@ test("current values are subtracted from totals and kept during recalculation", await expect(tool.locator(".calculator-result strong")).toHaveAttribute("aria-label", "8"); await tool.getByRole("button", { name: "Enregistrer", exact: true }).click(); await tool.getByRole("button", { name: "Ajouter un calcul enfant Parent", exact: true }).click(); + // Le calcul enfant remplace le champ par l'éditeur à jetons, qui prend le focus à l'image suivante : sur une machine lente, + // saisir avant ce passage perdait la formule. + await expect(expression).toHaveAttribute("contenteditable", "true"); + await expect(expression).toBeFocused(); await expression.fill("base * 10"); + await expect(tool.locator(".calculator-result strong")).toHaveAttribute("aria-label", "80"); await subtractCurrent.click(); await current.fill("20"); await tool.getByLabel("Libellé", { exact: true }).fill("Child");