Skip to content

test(money-input): update to accept new thousands separator for de-CH…#3225

Merged
ByronDWall merged 2 commits intomainfrom
vc/cldr-goodness
Mar 17, 2026
Merged

test(money-input): update to accept new thousands separator for de-CH…#3225
ByronDWall merged 2 commits intomainfrom
vc/cldr-goodness

Conversation

@valoriecarli
Copy link
Contributor

@valoriecarli valoriecarli commented Mar 16, 2026

Fix for the CI error seen here


A test for de-CH locale formatting in MoneyInput.parseMoneyValue started failing in CI but not locally.
The two failure values looked identical in the diff, which made it difficult to diagnose.

Root cause: The Swiss de-CH locale uses an apostrophe as a thousands separator, but the exact character depends on the Unicode locale data (CLDR) bundled with Node.js.
Two different characters were in play:

  • a right single quote (’, U+2019) and
  • a plain apostrophe (', U+0027)

But why now?

  • May 2025 - Test written against Node 22 / ICU 77.1, which produced U+2019 for de-CH. Hardcoded that character in the assertion, because... it's the whole point of that assertion.
  • Sep 2025 - CLDR 48 changed the de-CH thousands separator from U+2019 to U+0027.
  • Jan 2026 - ICU 78.2 shipped with the CLDR 48 change.
  • Feb 10, 2026 — Node 24.13.1 released, bundling ICU 78.2.
  • Last week - CI picked up Node 24.13.1+ (the workflow uses an unpinned node-version: '24'), causing toLocaleString('de-CH') to produce U+0027 instead of U+2019. (Local machines on Node 24.13.0 were
    unaffected).

The test description already acknowledged both characters as valid for de-CH. Updated the assertion to use a regex character class [\u2019'] which explicitly accepts either the right single quote or the plain apostrophe so the test is accurate across Node versions.

@valoriecarli valoriecarli self-assigned this Mar 16, 2026
@changeset-bot
Copy link

changeset-bot bot commented Mar 16, 2026

⚠️ No Changeset found

Latest commit: 1679d9c

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@vercel
Copy link

vercel bot commented Mar 16, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
ui-kit Ready Ready Preview, Comment Mar 16, 2026 5:20pm

Request Review

).toEqual({
amount: expect.stringMatching(/^1[\u2019\u0027]234\.567$/),
currencyCode: 'EUR',
});
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mixed feelings between this solution, or normalizing the output in formatAmount by replacing U+0027 → U+2019 after toLocaleString runs (thereby enforcing U+2019 as the canonical de-CH thousands separator
regardless of ICU version)

@valoriecarli valoriecarli marked this pull request as ready for review March 16, 2026 17:28
@valoriecarli valoriecarli requested a review from a team as a code owner March 16, 2026 17:28
@ByronDWall ByronDWall merged commit 6732b14 into main Mar 17, 2026
9 checks passed
@ByronDWall ByronDWall deleted the vc/cldr-goodness branch March 17, 2026 13:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants