Skip to content

Commit

Permalink
add some compact tests
Browse files Browse the repository at this point in the history
  • Loading branch information
chriskmnds committed Jan 22, 2025
1 parent 114010a commit 0fff918
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions packages/i18n-calypso/test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,27 @@ describe( 'I18n', function () {
).toBe( '2.500,330' );
} );
} );

describe( 'compact notation', function () {
describe( 'ar', () => {
beforeEach( function () {
i18n.setLocale( {
'': {
localeVariant: undefined,
localeSlug: 'ar',
},
} );
} );
test( 'defaults to latin notation and localised unit', () => {
expect( numberFormat( 1234, { notation: 'compact', decimals: 1 } ) ).toEqual( '1.2 ألف' );
} );
test( 'non-latin/original notation and localised unit', () => {
expect( numberFormat( 1234, { notation: 'compact', decimals: 1 }, false ) ).toEqual(
'١٫٢ ألف'
);
} );
} );
} );
} );

describe( 'hashed locale data', function () {
Expand Down

0 comments on commit 0fff918

Please sign in to comment.