Pin the buy e2e locale so the collection-IBAN test stops depending on account data - #1269
Conversation
… account data The test asserts English labels, but without a lang parameter the UI locale comes from the test account's stored user.language. That field lives on the server and was switched to German, so the English selectors find nothing and the test fails with "element(s) not found" - on unchanged code. Passing lang=en makes the test decide its own locale.
|
@marassteiner please review |
|
EN: Working on this now — job |
marassteiner
left a comment
There was a problem hiding this comment.
Review summary
Recommendation: approve
No merge-blockers. Test-only change; production code untouched. CI is green (Build and test, Analyze, CodeQL, review).
What changed
e2e/buy-process.spec.ts — collection-IBAN toggle test now opens the buy URL with &lang=en, so English role selectors (Payment Information, Show collection IBAN) no longer depend on mutable server-side user.language.
Gate A — diff review (conformity + logic)
Both independent review lanes completed a full pass over the PR diff vs develop and reported 0 findings.
- Locale priority in
settings.context.tsxislang(URL) →user.language→ store → browser; pinninglang=encorrectly overrides account language. - Matches existing e2e convention (
support-issue-receiver-iban.spec.ts,payment-and-special.spec.ts). - Scope matches the PR claim; comment documents the failure mode; no type-safety / security / semantic merge issues.
Gate B — local software run
| Step | Result |
|---|---|
npm ci |
Failed on review host with npm 11 / Node 24 (package.json vs lock out of sync for optional platform packages). Not attributable to this PR (diff does not touch lockfile/deps). |
npm install |
OK (fallback per review procedure) |
npm run lint |
OK (exit 0) |
CI=true npm run test -- --watchAll=false |
72 suites / 788 tests passed |
npm run start:dev (PORT=3019) |
Compiled (No issues found.); process listens on *:3019; GET http://127.0.0.1:3019/ → HTTP 200 |
Merge-blockers
None.
Follow-up findings
None filed. (A pre-existing sibling test in the same file also uses English labels without lang=en; it is outside this PR’s claim and not introduced or worsened here.)
CI
All PR checks green at review time: Build and test, Analyze, CodeQL, review.
No merge from this review.
What
e2e/buy-process.spec.ts→ theshould toggle between the personal and the collection IBANtest now opens the buy screen with&lang=en.Why
The test asserts English labels (
Payment Information,Show collection IBAN), but without alangparameter the UI locale is resolved as(
src/contexts/settings.context.tsx). With no parameter the locale therefore comes from the test account's storeduser.language— server-side data anyone can change. It is currently German, so the app rendersZahlungsinformation, the English selectors match nothing and the test fails withelement(s) not found.Evidence
Run against an unmodified checkout of the current
develop(51ce782), repo-pinned Playwright 1.57.0:lang=enelement(s) not foundlang=enThe baseline screenshots are unchanged by this PR — the parameter changes the locale, not the rendering that the baselines capture.
Scope
Test-only, four lines (three of them the comment explaining the failure mode). No production code, no other test touched.
Necessity
Symptom (verbatim):
Error: expect(locator).toBeVisible() failed—Locator: getByRole('heading', { name: 'Payment Information' }).locator('..').getByRole('button', { name: 'Show collection IBAN' })—Error: element(s) not found. Reproduced on an unmodified checkout of develop 51ce782, so it is not caused by any code change.Scale: this test is the only visual guard for the collection-IBAN UI, and it fails for every developer whose test account language is not English. The account language changed after the test was written on 2026-08-04, and two people hit it on that same day. It also blocks validating the two regenerated baselines in #1270.
Smaller fix considered: setting the test account language back to English on the dev API, zero lines of code — insufficient because that is mutable server-side state which the next person can change back, which is exactly how the test broke in the first place.