From c5eddef31ddde5a620a899e4cee9d6a42995d8c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Bombeck?= Date: Sun, 5 Jul 2026 22:41:43 +0200 Subject: [PATCH] test(e2e): pin the shared auth state to an explicit English locale cookie MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The server honours User.locale when the locale cookie is absent now, and the locale-switch spec mirrors its German pick into the shared e2e user's profile — every spec running after it rendered German and the English-string assertions failed. The explicit cookie sits at the top of the resolution ladder, keeping each spec context deterministic; locale-switch still overrides it inside its own context. --- e2e/setup/global-setup.ts | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/e2e/setup/global-setup.ts b/e2e/setup/global-setup.ts index 6f9d7f854..111068f4a 100644 --- a/e2e/setup/global-setup.ts +++ b/e2e/setup/global-setup.ts @@ -203,6 +203,26 @@ export default async function globalSetup(config: FullConfig): Promise { state.cookies = state.cookies.filter((c) => ["healthlog_session", "healthlog-locale", "hl_onboarding"].includes(c.name), ); + // v1.27.11 — pin the shared auth state to English via an explicit locale + // cookie. The server now honours `User.locale` when the cookie is absent + // (the ITP fix), and the locale-switch spec mirrors its German pick into + // the SHARED e2e user's profile — without this cookie every spec running + // after it would render German and the English-string assertions fail. + // The cookie sits at the top of the resolution ladder, so each spec + // context stays deterministically English; locale-switch overrides it + // inside its own context only. + const base = new URL(baseURL); + state.cookies = state.cookies.filter((c) => c.name !== "healthlog-locale"); + state.cookies.push({ + name: "healthlog-locale", + value: "en", + domain: base.hostname, + path: "/", + expires: Math.floor(Date.now() / 1000) + 60 * 60 * 24 * 365, + httpOnly: false, + secure: false, + sameSite: "Lax", + }); await writeFile(STORAGE_STATE_PATH, JSON.stringify(state, null, 2)); await ctx.dispose(); console.log(