From 9132f085070a99499a75d6353983bd1683f7a3f0 Mon Sep 17 00:00:00 2001 From: Zac Mitton Date: Mon, 20 Jun 2016 18:46:29 -0400 Subject: added a failing case and fixed it by refactoring everything to strings --- test/unit/util_test.js | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'test/unit') diff --git a/test/unit/util_test.js b/test/unit/util_test.js index 12a16999e..e2390c8d4 100644 --- a/test/unit/util_test.js +++ b/test/unit/util_test.js @@ -25,12 +25,26 @@ describe('util', function() { }) }) describe('parseBalance', function() { - it('should render 0.01 eth correctly', function() { + it('should render 12.023 eth correctly', function() { const input = 'A6DA46CCA6858000' const output = util.parseBalance(input) assert.deepEqual(output, ['12', '023']) }) }) + describe('parseBalance', function() { + it('should render 0.0000000342422 eth correctly', function() { + const input = '0x7F8FE81C0' + const output = util.parseBalance(input) + assert.deepEqual(output, ['0', '0000000342422']) + }) + }) + describe('parseBalance', function() { + it('should render 0 eth correctly', function() { + const input = '0x0' + const output = util.parseBalance(input) + assert.deepEqual(output, ['0', '0']) + }) + }) describe('addressSummary', function() { it('should add case-sensitive checksum', function() { -- cgit v1.2.3