Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

STCOM-1379 pin currency-codes to avoid unexpected dupes #2383

Merged
merged 1 commit into from
Nov 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
* Include Kosovo in the countries list. Refs STCOM-1354.
* `<RepeatableField>` - switch to MutationObserver to resolve focus-management issues. Refs STCOM-1372.
* Bump `stripes-react-hotkeys` to `v3.2.0` for compatibility with `findDOMNode()` changes. STCOM-1343.
* Pin `currency-codes` to `v2.1.0` to avoid duplicate entries in `v2.2.0`. Refs STCOM-1379.

## [12.2.0](https://github.com/folio-org/stripes-components/tree/v12.2.0) (2024-10-11)
[Full Changelog](https://github.com/folio-org/stripes-components/compare/v12.1.0...v12.2.0)
Expand Down
18 changes: 17 additions & 1 deletion lib/CurrencySelect/tests/CurrencySelect-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,26 @@ describe('CurrencySelect', () => {

describe('utility functions', () => {
const CURRENCY_COUNT = 159;
it('expects currency maps to contain the same element counts', () => {
it('expects currency maps to contain the same element counts (reduce by CODE)', () => {
expect(Object.keys(currenciesByCode).length).to.equal(CURRENCY_COUNT);
});

// this test fails with currency-codes v2.2.0 which supplies duplicate
// entries for Bolívar Soberano. it isn't clear if this is intentional
// (and so this map-by-name function should never have been written) or
// accidental (names are unique in previous releases).
//
// if we unpin the dependency from v2.1.0 then we need to remove this function,
// a breaking change. leave comments at STCOM-1379.
it('expects currency maps to contain the same element counts (reduce by NAME)', () => {
expect(Object.keys(currenciesByName).length).to.equal(CURRENCY_COUNT);
});

it('expects currency maps to contain the same element counts (reduce by NUMBER)', () => {
expect(Object.keys(currenciesByNumber).length).to.equal(CURRENCY_COUNT);
});

it('expects currency maps to contain the same element counts', () => {
expect(currenciesOptions.length).to.equal(CURRENCY_COUNT);
});

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@
"@csstools/postcss-global-data": "^2.1.1",
"@folio/stripes-react-hotkeys": "^3.2.1",
"classnames": "^2.2.5",
"currency-codes": "^2.1.0",
"currency-codes": "2.1.0",
"dayjs": "^1.11.10",
"downshift": "^9.0.4",
"flexboxgrid2": "^7.2.0",
Expand Down
2 changes: 1 addition & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -7540,7 +7540,7 @@ ctrlc-windows@^2.1.0:
resolved "https://registry.yarnpkg.com/ctrlc-windows/-/ctrlc-windows-2.1.0.tgz#f2096a96ac1d03181e0ec808c2c8a67fdc20b300"
integrity sha512-OrX5KI+K+2NMN91QIhYZdW7VDO2YsSdTZW494pA7Nvw/wBdU2hz+MGP006bR978zOTrG6Q8EIeJvLJmLqc6MsQ==

currency-codes@^2.1.0:
[email protected]:
version "2.1.0"
resolved "https://registry.yarnpkg.com/currency-codes/-/currency-codes-2.1.0.tgz#6d84a1b7fec70ecb9ef64e57bf60f4271899044c"
integrity sha512-aASwFNP8VjZ0y0PWlSW7c9N/isYTLxK6OCbm7aVuQMk7dWO2zgup9KGiFQgeL9OGL5P/ulvCHcjQizmuEeZXtw==
Expand Down
Loading