Skip to content

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

Merged
DeusData merged 1 commit into
DeusData:mainfrom
sahil-mangla:main
Jul 4, 2026
Merged

test(graph-ui): fix locale-dependent number-format assertion in GraphTab.test.ts#839
DeusData merged 1 commit into
DeusData:mainfrom
sahil-mangla:main

Conversation

@sahil-mangla

Copy link
Copy Markdown
Contributor

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

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

…Tab.test.ts

Pin formatGraphLimitNotice to 'en-US' to resolve unit test failures under non-en_US (e.g. German de_*) locales.

Fixes DeusData#825

Signed-off-by: sahil-mangla <manglasahil2017@gmail.com>
@sahil-mangla sahil-mangla requested a review from DeusData as a code owner July 4, 2026 09:04
@DeusData DeusData added bug Something isn't working ux/behavior Display bugs, docs, adoption UX priority/backlog Valuable contribution, lower scheduling urgency; review when maintainer capacity opens. labels Jul 4, 2026
@DeusData

DeusData commented Jul 4, 2026

Copy link
Copy Markdown
Owner

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 DeusData merged commit 093eaf1 into DeusData:main Jul 4, 2026
14 checks passed
@DeusData

DeusData commented Jul 4, 2026

Copy link
Copy Markdown
Owner

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 093eaf1; closes #825. Appreciated!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working priority/backlog Valuable contribution, lower scheduling urgency; review when maintainer capacity opens. ux/behavior Display bugs, docs, adoption UX

Projects

None yet

Development

Successfully merging this pull request may close these issues.

test(graph-ui): GraphTab number-format assertion is locale-dependent

2 participants