From 8994be2352fd5b8ea2fb0ae2398095f1bef14dd0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=ABl=20R=2E=20Langlois?= Date: Mon, 16 Nov 2026 14:49:10 -0500 Subject: [PATCH] test(ui-gate): pin the browser's locale to en-US MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The gate's gauge expectations are literals - eg: a cost of "$0.42", "50K" tokens - which are what en-US renders. On my machine - which is en-CA - the formatted numbers come through a bit differently (eg: "US$0.42" through `Intl.NumberFormat`). This fails 16 checks a clean checkout at HEAD. This PR fixes the gate across all systems by pinning the locale to en-US. Signed-off-by: Joël R. Langlois --- scripts/ui-gate/shots.mjs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/scripts/ui-gate/shots.mjs b/scripts/ui-gate/shots.mjs index 01bd280a..69055b27 100644 --- a/scripts/ui-gate/shots.mjs +++ b/scripts/ui-gate/shots.mjs @@ -96,7 +96,12 @@ async function hostCopy(p, locator) { } async function page(browser, themeName, { width, height }) { - const p = await browser.newPage({ viewport: { width, height } }); + // The gate's literal expectations — a cost of "$0.42", "50K" tokens — are + // what en-US renders, so the page's locale is pinned rather than left to + // whatever locale the machine running the gate resolves (en-CA says + // "US$0.42", which would fail checks no code changed). A date read-out is + // never pinned this way: a scenario asks the page itself what it says. + const p = await browser.newPage({ locale: "en-US", viewport: { width, height } }); p.on("pageerror", (e) => { // fixture pages must render clean — a page error is itself a failure console.log(`FAIL [${themeName}] pageerror: ${String(e).slice(0, 200)}`);