codebase-memory-mcp icon indicating copy to clipboard operation
codebase-memory-mcp copied to clipboard

test(graph-ui): fix locale-dependent number-format assertion in GraphTab.test.ts

Open sahil-mangla opened this issue 5 months ago • 1 comments

What does this PR do?

Pins the number formatting in formatGraphLimitNotice to the 'en-US' locale.

Previously, the use of toLocaleString() without specifying a locale caused numbers to format according to the host machine's system locale (e.g., 2.000 under German locales like de-DE instead of 2,000). This caused the unit test in GraphTab.test.ts to fail on any developer machine configured with a non-en_US locale. Explicitly pinning this to 'en-US' ensures consistent, environment-independent formatting for tests and the English UI message.

Fixes #825

Checklist

  • [x] Every commit is signed off (git commit -s) — required, CI rejects unsigned commits (DCO, see CONTRIBUTING.md)
  • [x] Tests pass locally (make -f Makefile.cbm test / npm run test in graph-ui)
  • [x] Lint/Build passes (npm run build in graph-ui)
  • [x] New behavior is covered by a test (reproduce-first for bug fixes)

sahil-mangla avatar Jul 04 '26 09:07 sahil-mangla

Thanks for the focused locale-stability fix for #825. Triage: graph UI test/UX bug, backlog priority.

Review will check that pinning en-US is intentional for this English UI notice, and that the test remains stable on non-English developer machines without masking future i18n work. This looks nicely scoped.

DeusData avatar Jul 04 '26 09:07 DeusData

Thank you — this is the right fix: pinning the format to toLocaleString("en-US") in the component makes the count deterministic regardless of the viewer's host locale, rather than just patching the test assertion. The surrounding notice is English-only so the digit grouping stays consistent. Merged as 093eaf17; closes #825. Appreciated!

DeusData avatar Jul 04 '26 17:07 DeusData