From 5424ab0b60f36f42ac48e3320686ffa61a607c19 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Bombeck?= Date: Fri, 31 Jul 2026 23:31:00 +0200 Subject: [PATCH] Assert the settings heading that the width actually shows The shell renders the heading pair twice under distinct ids, one column hidden below the medium breakpoint and one hidden above it, so exactly one is ever on screen. The spec asserted the desktop id alone: green on the wide project, red on the narrow one against a heading that is hidden by design. It now follows whichever of the two the viewport reveals, and asserts that exactly one is visible, so a real duplicate would still fail. --- e2e/settings-score.spec.ts | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/e2e/settings-score.spec.ts b/e2e/settings-score.spec.ts index 2f8f3a24a..9d77e0bd3 100644 --- a/e2e/settings-score.spec.ts +++ b/e2e/settings-score.spec.ts @@ -101,10 +101,21 @@ test.describe("Settings → Health Score", () => { await settleBeforeMeasure(page, card); // The heading + subheading pair the settings IA requires, owned by the - // shell and not re-declared inside the card. - await expect(page.locator("#settings-section-score-title")).toBeVisible(); + // shell and not re-declared inside the card. The shell renders the pair + // twice under distinct ids — `…-title` inside a `hidden md:block` column + // and `…-title-mobile` inside an `md:hidden` one — so exactly one of them + // is on screen at any width. Asserting the desktop id alone passed on the + // wide project and failed on the narrow one against a heading that is + // hidden by design. + const heading = page + .locator( + "#settings-section-score-title, #settings-section-score-title-mobile", + ) + .filter({ has: page.locator(":scope:visible") }); + await expect(heading).toHaveCount(1); + await expect(heading.first()).toBeVisible(); await expect( - page.locator("#settings-section-score-title + p"), + heading.first().locator("xpath=following-sibling::p[1]"), ).toBeVisible(); // One concept, one card. A second card beside it would be the