aboutsummaryrefslogtreecommitdiffstats
path: root/ui/test
diff options
context:
space:
mode:
authorDan Finlay <somniac@me.com>2016-04-15 04:24:53 +0800
committerDan Finlay <somniac@me.com>2016-04-15 04:24:53 +0800
commit2f8a5d1c3a1f472aecfaac959f07c7f013512d39 (patch)
treec98b6cd328ea969f6702de724f33015b010cbefb /ui/test
parent9be7bebbb3f5450a7ddf82ccb4e07e49725e8cf7 (diff)
parente10480dec19e196d942505e32b3bcec3ec88c250 (diff)
downloadtangerine-wallet-browser-2f8a5d1c3a1f472aecfaac959f07c7f013512d39.tar
tangerine-wallet-browser-2f8a5d1c3a1f472aecfaac959f07c7f013512d39.tar.gz
tangerine-wallet-browser-2f8a5d1c3a1f472aecfaac959f07c7f013512d39.tar.bz2
tangerine-wallet-browser-2f8a5d1c3a1f472aecfaac959f07c7f013512d39.tar.lz
tangerine-wallet-browser-2f8a5d1c3a1f472aecfaac959f07c7f013512d39.tar.xz
tangerine-wallet-browser-2f8a5d1c3a1f472aecfaac959f07c7f013512d39.tar.zst
tangerine-wallet-browser-2f8a5d1c3a1f472aecfaac959f07c7f013512d39.zip
Merge pull request #109 from MetaMask/FixEthResolution
Fix eth resolution
Diffstat (limited to 'ui/test')
-rw-r--r--ui/test/unit/util_test.js16
1 files changed, 14 insertions, 2 deletions
diff --git a/ui/test/unit/util_test.js b/ui/test/unit/util_test.js
index 52635eb89..7e34bba1c 100644
--- a/ui/test/unit/util_test.js
+++ b/ui/test/unit/util_test.js
@@ -63,9 +63,21 @@ describe('util', function() {
})
it('should return eth as string followed by ETH', function() {
- var input = new ethUtil.BN(ethInWei).toJSON()
+ var input = new ethUtil.BN(ethInWei, 10).toJSON()
var result = util.formatBalance(input)
- assert.equal(result, '1 ETH')
+ assert.equal(result, '1.0000 ETH')
+ })
+
+ it('should return eth as string followed by ETH', function() {
+ var input = new ethUtil.BN(ethInWei, 10).div(new ethUtil.BN('2', 10)).toJSON()
+ var result = util.formatBalance(input)
+ assert.equal(result, '.5000 ETH')
+ })
+
+ it('should display four decimal points', function() {
+ var input = "0x128dfa6a90b28000"
+ var result = util.formatBalance(input)
+ assert.equal(result, '1.3370 ETH')
})
})