mirror of
https://github.com/DOI-DO/j40-cejst-2.git
synced 2025-08-27 15:21:39 -07:00
fixes percentiles (#583)
- aligns superscript position - adds intl.plural rules fn to add ordinal superscripts - updates units tests - updates snapshot
This commit is contained in:
parent
f5c4ba6d88
commit
40c8548292
5 changed files with 68 additions and 13 deletions
|
@ -1,6 +1,6 @@
|
|||
import * as React from 'react';
|
||||
import {render} from '@testing-library/react';
|
||||
import AreaDetail, {getCategorization, readablePercent} from '..';
|
||||
import AreaDetail, {getCategorization, readablePercentile} from '..';
|
||||
import {LocalizedComponent} from '../../../test/testHelpers';
|
||||
import * as constants from '../../../data/constants';
|
||||
|
||||
|
@ -28,8 +28,11 @@ describe('rendering of the AreaDetail', () => {
|
|||
});
|
||||
});
|
||||
|
||||
describe('tests the readablePercent function', () => {
|
||||
expect(readablePercent(.9877665443)).toEqual('98.8');
|
||||
describe('tests the readablePercentile function', () => {
|
||||
expect(readablePercentile(.98)).toEqual(98);
|
||||
expect(readablePercentile(.07)).toEqual(7);
|
||||
expect(readablePercentile(.123)).toEqual(12);
|
||||
expect(readablePercentile(.789)).toEqual(79);
|
||||
});
|
||||
|
||||
describe('tests the getCategorization function', () => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue