Skip to content

Commit c775a5b

Browse files
rubenvdlindeConduction Release Bot
andauthored
fix(e2e): match the dashboard labels in either locale (#918)
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. Co-authored-by: Conduction Release Bot <release-bot@conduction.nl>
1 parent 5fd965b commit c775a5b

1 file changed

Lines changed: 17 additions & 8 deletions

File tree

tests/e2e/spec-coverage/dashboard.spec.ts

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,19 +31,28 @@ test('dashboard: renders the overview surface (stat tiles and the object statist
3131
// heading; that surface was replaced when the KPI tiles landed, and this
3232
// spec kept asserting the old one.
3333
//
34-
// Labels are asserted in DUTCH because the e2e instance runs Dutch, and
35-
// they are NOT all identical to the manifest source: the manifest says
36-
// "Services" and nl.json maps it to "Diensten". Asserting the English
37-
// source here would pass only on an English instance.
38-
for (const label of ['Organisaties', 'Modules', 'Diensten', 'Contracten']) {
34+
// Matched against BOTH the manifest source and its nl.json translation.
35+
// Two of these differ between the two: the manifest says "Services" and
36+
// "Object statistics", which nl.json maps to "Diensten" and "Object
37+
// statistieken". Pinning either one couples the spec to whichever locale
38+
// the instance happens to boot in, and that is exactly how the previous
39+
// version of this test failed: it asserted Dutch against an instance
40+
// rendering the English source.
41+
const tiles: RegExp[] = [
42+
/Organisaties/,
43+
/Modules/,
44+
/Services|Diensten/,
45+
/Contracten/,
46+
]
47+
for (const label of tiles) {
3948
await expect(
40-
main.getByText(label, { exact: false }).first(),
41-
`the ${label} stat tile must render`,
49+
main.getByText(label).first(),
50+
`the ${label.source} stat tile must render`,
4251
).toBeVisible({ timeout: 30000 })
4352
}
4453

4554
await expect(
46-
main.getByText('Object statistieken', { exact: false }).first(),
55+
main.getByText(/Object statistics|Object statistieken/).first(),
4756
'the object statistics panel must render',
4857
).toBeVisible({ timeout: 30000 })
4958

0 commit comments

Comments
 (0)