four digit numbers can be written without separator, so it would be safer to obtain the separator by formatting a five digit number. The bug was found with the locale 'es-ES', where the format returned for '1000' was '1000' instead of the expected '1.000'. We add the specific expect clause on the test for it. On branch fix/numberGroupSeparator Changes to be committed: modified: packages/localize/src/number/getGroupSeparator.js modified: packages/localize/test/number/getGroupSeparator.test.js
12 lines
435 B
JavaScript
12 lines
435 B
JavaScript
import { expect } from '@open-wc/testing';
|
|
|
|
import { getGroupSeparator } from '../../src/number/getGroupSeparator.js';
|
|
|
|
describe('getGroupSeparator', () => {
|
|
it('returns group separator for locale', () => {
|
|
expect(getGroupSeparator('en-GB')).to.equal(',');
|
|
expect(getGroupSeparator('nl-NL')).to.equal('.');
|
|
expect(getGroupSeparator('fr-FR')).to.equal(' ');
|
|
expect(getGroupSeparator('es-ES')).to.equal('.');
|
|
});
|
|
});
|