From d23770745b4651cec1ad2304ca11b30870b61fc7 Mon Sep 17 00:00:00 2001 From: Conduction Release Bot Date: Tue, 1 Sep 2026 11:22:54 +0200 Subject: [PATCH] fix(e2e): match the dashboard labels in either locale My previous fix pinned the tile labels to DUTCH and the overview test still failed: Error: the Diensten stat tile must render waiting for locator("main").first().getByText("Diensten").first() The instance renders the ENGLISH manifest source. I inferred the locale from the OLD assertions, which asserted Dutch and were themselves failing, so the inference was circular: I read a broken test as evidence of what the app does. The three tiles whose manifest label is already Dutch (Organisaties, Modules, Contracten) passed either way, which is what hid it. Only Services and Object statistics have an nl.json entry, and those are exactly the two that broke. Both now match either spelling, the same shape as the sbom-import fix in the previous commit, which worked for this reason. --- tests/e2e/spec-coverage/dashboard.spec.ts | 25 +++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/tests/e2e/spec-coverage/dashboard.spec.ts b/tests/e2e/spec-coverage/dashboard.spec.ts index 847993b2..5458d417 100644 --- a/tests/e2e/spec-coverage/dashboard.spec.ts +++ b/tests/e2e/spec-coverage/dashboard.spec.ts @@ -31,19 +31,28 @@ test('dashboard: renders the overview surface (stat tiles and the object statist // heading; that surface was replaced when the KPI tiles landed, and this // spec kept asserting the old one. // - // Labels are asserted in DUTCH because the e2e instance runs Dutch, and - // they are NOT all identical to the manifest source: the manifest says - // "Services" and nl.json maps it to "Diensten". Asserting the English - // source here would pass only on an English instance. - for (const label of ['Organisaties', 'Modules', 'Diensten', 'Contracten']) { + // Matched against BOTH the manifest source and its nl.json translation. + // Two of these differ between the two: the manifest says "Services" and + // "Object statistics", which nl.json maps to "Diensten" and "Object + // statistieken". Pinning either one couples the spec to whichever locale + // the instance happens to boot in, and that is exactly how the previous + // version of this test failed: it asserted Dutch against an instance + // rendering the English source. + const tiles: RegExp[] = [ + /Organisaties/, + /Modules/, + /Services|Diensten/, + /Contracten/, + ] + for (const label of tiles) { await expect( - main.getByText(label, { exact: false }).first(), - `the ${label} stat tile must render`, + main.getByText(label).first(), + `the ${label.source} stat tile must render`, ).toBeVisible({ timeout: 30000 }) } await expect( - main.getByText('Object statistieken', { exact: false }).first(), + main.getByText(/Object statistics|Object statistieken/).first(), 'the object statistics panel must render', ).toBeVisible({ timeout: 30000 })