Skip to content

Commit 220ddc3

Browse files
committed
test: cover mini-decimal scientific notation fix
1 parent fdde44f commit 220ddc3

4 files changed

Lines changed: 8 additions & 17 deletions

File tree

jest.config.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module.exports = {
2+
setupFiles: ['./tests/setup.js'],
3+
};

jest.config.ts

Lines changed: 0 additions & 16 deletions
This file was deleted.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
]
4646
},
4747
"dependencies": {
48-
"@rc-component/mini-decimal": "^1.0.1",
48+
"@rc-component/mini-decimal": "^1.1.1",
4949
"@rc-component/util": "^1.4.0",
5050
"clsx": "^2.1.1"
5151
},

tests/decimal.test.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,10 @@ describe('InputNumber.Decimal', () => {
6464
expect(container.querySelector('input').value).toEqual('0.1');
6565
});
6666

67+
it('should not crash when scientific notation precision exceeds native toFixed limit', () => {
68+
expect(() => render(<InputNumber defaultValue={1e-307} />)).not.toThrow();
69+
});
70+
6771
it('custom decimal separator', () => {
6872
const onChange = jest.fn();
6973
const { container } = render(<InputNumber decimalSeparator="," onChange={onChange} />);

0 commit comments

Comments
 (0)