Skip to content

Commit

Permalink
test: util number add case
Browse files Browse the repository at this point in the history
  • Loading branch information
lissavxo committed May 20, 2024
1 parent a4a26f5 commit 4eb35d3
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions react/lib/tests/number.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down

0 comments on commit 4eb35d3

Please sign in to comment.