fix: compute burndown e2e month label in the browser to match the page's locale#105
Conversation
…e's locale The "shows current month" assertion (made dynamic in microsoft#88) derives the expected month from `new Date().toLocaleString('default', …)` in the Node test process, while page-burndown.ts formats the label the same way in the browser. Node and Chromium can resolve the 'default' locale differently: on a non-en-US host the Node process yields a localized month (e.g. German "Juni 2026") while the page renders "June 2026", so the assertion fails anywhere off en-US even though the app itself is correct. Compute the expected label inside the page via `page.evaluate`, so it always uses the same runtime and locale as the rendered label while still tracking the live month (no hard-coding, no monthly staleness). Verified red→green on a German-locale (de-AT) host: tests/e2e/burndown.spec.ts passes 5/5.
|
@JuliusGruber Thanks for your PR, Please agree with contributor license agreement https://github.com/microsoft/ContributorLicenseAgreement |
|
Code review: Approve ✓ The fix is correct — computing One note: The burndown e2e tests currently do not run in CI (
None of that blocks this PR — merging as-is is safe. |
|
@microsoft-github-policy-service agree |
Problem
tests/e2e/burndown.spec.ts› "shows current month" fails on any non-en-US host.The assertion (made dynamic in #88) derives the expected month in the Node test process:
but
page-burndown.tsformats the label the same way in the browser (formatMonthLabel). Node and Chromium can resolve the'default'locale differently — on a German-locale host Node yields"Juni 2026"while the page renders"June 2026"— so the assertion fails everywhere off en-US, even though the app is correct. CI stays green only because it runs en-US, where the two runtimes happen to agree.Fix
Compute the expected label inside the page via
page.evaluate, so it always uses the same runtime and locale as the rendered label — while still tracking the live month with no hard-coding (preserving #88's intent: no monthly staleness).Verification
tests/e2e/burndown.spec.tspasses 5/5 on a German-locale (de-AT) host — previously 4/5, with this test red.🤖 Generated with Claude Code