aboutsummaryrefslogtreecommitdiffstats
path: root/test/unit
diff options
context:
space:
mode:
authorDan Finlay <dan@danfinlay.com>2017-05-17 15:19:31 +0800
committerDan Finlay <dan@danfinlay.com>2017-05-17 15:19:31 +0800
commite26501aa0192b26880a8fe63f41d76fdfa849d7b (patch)
tree062f007dba14789970ff258fb58ce6c22bb0e0bf /test/unit
parentc2b012ccc577da1c07b5467d9b3364159eeea7b8 (diff)
downloadtangerine-wallet-browser-e26501aa0192b26880a8fe63f41d76fdfa849d7b.tar
tangerine-wallet-browser-e26501aa0192b26880a8fe63f41d76fdfa849d7b.tar.gz
tangerine-wallet-browser-e26501aa0192b26880a8fe63f41d76fdfa849d7b.tar.bz2
tangerine-wallet-browser-e26501aa0192b26880a8fe63f41d76fdfa849d7b.tar.lz
tangerine-wallet-browser-e26501aa0192b26880a8fe63f41d76fdfa849d7b.tar.xz
tangerine-wallet-browser-e26501aa0192b26880a8fe63f41d76fdfa849d7b.tar.zst
tangerine-wallet-browser-e26501aa0192b26880a8fe63f41d76fdfa849d7b.zip
Simplify test to represent realistic use case
Diffstat (limited to 'test/unit')
-rw-r--r--test/unit/components/bn-as-decimal-input-test.js16
1 files changed, 6 insertions, 10 deletions
diff --git a/test/unit/components/bn-as-decimal-input-test.js b/test/unit/components/bn-as-decimal-input-test.js
index 4ea910fb0..1f589c210 100644
--- a/test/unit/components/bn-as-decimal-input-test.js
+++ b/test/unit/components/bn-as-decimal-input-test.js
@@ -14,24 +14,20 @@ describe.only('BnInput', function () {
const buffer = new Buffer(message, 'utf8')
const hex = buffer.toString('hex')
- it('can tolerate a large number at a high precision', function (done) {
+ it('can tolerate a gas decimal number at a high precision', function (done) {
const renderer = ReactTestUtils.createRenderer();
- let valueStr = '1'
- while (valueStr.length < 18 + 7) {
+ let valueStr = '20'
+ while (valueStr.length < 20) {
valueStr += '0'
}
const value = new BN(valueStr, 10)
- let inputStr = '11'
- while (inputStr.length < 7) {
- inputStr += '0'
- }
- inputStr += '.01'
+ let inputStr = '2.3'
- let targetStr = inputStr.split('.').join()
- while (targetStr.length < 18 + 7) {
+ let targetStr = '23'
+ while (targetStr.length < 19) {
targetStr += '0'
}
const target = new BN(targetStr, 10)