aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorDan Finlay <somniac@me.com>2016-06-22 00:19:37 +0800
committerGitHub <noreply@github.com>2016-06-22 00:19:37 +0800
commitcfc056e34ba6dda983a1ca6b4bc090661b799d38 (patch)
tree35373fb089eb7546a42afdd4f8dc0e810d4b1bf0 /test
parent6fdece459d1d2674acc5349b70e68c1d5033dd38 (diff)
parentbd6ee81d097f3da2fcfbfb7b7d29d5daf706eb1d (diff)
downloadtangerine-wallet-browser-cfc056e34ba6dda983a1ca6b4bc090661b799d38.tar
tangerine-wallet-browser-cfc056e34ba6dda983a1ca6b4bc090661b799d38.tar.gz
tangerine-wallet-browser-cfc056e34ba6dda983a1ca6b4bc090661b799d38.tar.bz2
tangerine-wallet-browser-cfc056e34ba6dda983a1ca6b4bc090661b799d38.tar.lz
tangerine-wallet-browser-cfc056e34ba6dda983a1ca6b4bc090661b799d38.tar.xz
tangerine-wallet-browser-cfc056e34ba6dda983a1ca6b4bc090661b799d38.tar.zst
tangerine-wallet-browser-cfc056e34ba6dda983a1ca6b4bc090661b799d38.zip
Merge pull request #299 from MetaMask/balances-bug-fix
added a failing case and fixed it by refactoring everything to strings
Diffstat (limited to 'test')
-rw-r--r--test/unit/util_test.js16
1 files changed, 15 insertions, 1 deletions
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() {