aboutsummaryrefslogtreecommitdiffstats
path: root/test/unit/util_test.js
diff options
context:
space:
mode:
authorKevin Serrano <kevgagser@gmail.com>2016-07-12 04:57:47 +0800
committerKevin Serrano <kevgagser@gmail.com>2016-07-12 04:57:47 +0800
commit31d0d1ec080546b591d0c8ffd85c8bd983791f99 (patch)
treec9cbbf3bbe51ac851a3baad3867af08d3c4acc94 /test/unit/util_test.js
parent5bb075a27810064b967dbee169f35abf449fd714 (diff)
downloadtangerine-wallet-browser-31d0d1ec080546b591d0c8ffd85c8bd983791f99.tar
tangerine-wallet-browser-31d0d1ec080546b591d0c8ffd85c8bd983791f99.tar.gz
tangerine-wallet-browser-31d0d1ec080546b591d0c8ffd85c8bd983791f99.tar.bz2
tangerine-wallet-browser-31d0d1ec080546b591d0c8ffd85c8bd983791f99.tar.lz
tangerine-wallet-browser-31d0d1ec080546b591d0c8ffd85c8bd983791f99.tar.xz
tangerine-wallet-browser-31d0d1ec080546b591d0c8ffd85c8bd983791f99.tar.zst
tangerine-wallet-browser-31d0d1ec080546b591d0c8ffd85c8bd983791f99.zip
Refactor util tests.
Diffstat (limited to 'test/unit/util_test.js')
-rw-r--r--test/unit/util_test.js19
1 files changed, 8 insertions, 11 deletions
diff --git a/test/unit/util_test.js b/test/unit/util_test.js
index 28f76fcf1..91c7c83e9 100644
--- a/test/unit/util_test.js
+++ b/test/unit/util_test.js
@@ -17,28 +17,25 @@ describe('util', function() {
this.sinon.restore()
})
- describe('parseBalance', function() {
+ describe('#parseBalance', function() {
it('should render 0.01 eth correctly', function() {
const input = '0x2386F26FC10000'
const output = util.parseBalance(input)
assert.deepEqual(output, ['0', '01'])
})
- })
- describe('parseBalance', 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)
@@ -46,7 +43,7 @@ describe('util', function() {
})
})
- describe('addressSummary', function() {
+ describe('#addressSummary', function() {
it('should add case-sensitive checksum', function() {
var address = '0xfdea65c8e26263f6d9a1b5de9555d2931a33b825'
var result = util.addressSummary(address)
@@ -60,7 +57,7 @@ describe('util', function() {
})
})
- describe('isValidAddress', function() {
+ describe('#isValidAddress', function() {
it('should allow 40-char non-prefixed hex', function() {
var address = 'fdea65c8e26263f6d9a1b5de9555d2931a33b825'
var result = util.isValidAddress(address)
@@ -106,7 +103,7 @@ describe('util', function() {
})
})
- describe('numericBalance', function() {
+ describe('#numericBalance', function() {
it('should return a BN 0 if given nothing', function() {
var result = util.numericBalance()
@@ -211,7 +208,7 @@ describe('util', function() {
})
})
- describe('normalizeEthStringToWei', function() {
+ describe('#normalizeEthStringToWei', function() {
it('should convert decimal eth to pure wei BN', function() {
var input = '1.23456789'
var output = util.normalizeEthStringToWei(input)