From 4eb35d337e5b0885b3c53b9b6e0a409966200861 Mon Sep 17 00:00:00 2001 From: lissavxo Date: Mon, 20 May 2024 18:11:20 -0300 Subject: [PATCH] test: util number add case --- react/lib/tests/number.test.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/react/lib/tests/number.test.ts b/react/lib/tests/number.test.ts index 1fa5b892..f2a968c4 100644 --- a/react/lib/tests/number.test.ts +++ b/react/lib/tests/number.test.ts @@ -24,6 +24,18 @@ describe('resolveNumber', () => { expect(result).toBeInstanceOf(BigNumber); expect(result.isEqualTo(42.8)).toBe(true); }); + + it('should convert float type with only zero after the decimal point to BigNumber int', () => { + const result = resolveNumber(42.0) + expect(result).toBeInstanceOf(BigNumber); + expect(result.isEqualTo(42)).toBe(true); + }); + + it('should convert string float type with only zero after the decimal point to BigNumber int', () => { + const result = resolveNumber(42.0) + expect(result).toBeInstanceOf(BigNumber); + expect(result.isEqualTo(42)).toBe(true); + }); it('should convert string representation of float type to BigNumber', () => { const result = resolveNumber('42.8')