From daec4d5c3639f7a97862ba87df749fbcd9a46c17 Mon Sep 17 00:00:00 2001 From: Dan Finlay Date: Mon, 21 Nov 2016 19:19:34 -0800 Subject: Fix ropsten link test --- test/unit/account-link-test.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'test/unit') diff --git a/test/unit/account-link-test.js b/test/unit/account-link-test.js index 39889b6be..08d190f71 100644 --- a/test/unit/account-link-test.js +++ b/test/unit/account-link-test.js @@ -3,8 +3,8 @@ var linkGen = require('../../ui/lib/account-link') describe('account-link', function() { - it('adds testnet prefix to morden test network', function() { - var result = linkGen('account', '2') + it('adds testnet prefix to ropsten test network', function() { + var result = linkGen('account', '3') assert.notEqual(result.indexOf('testnet'), -1, 'testnet injected') assert.notEqual(result.indexOf('account'), -1, 'account included') }) -- cgit v1.2.3 From 694f34ae9a11dbe0ea6f484defe2d8f9e55da82a Mon Sep 17 00:00:00 2001 From: Dan Finlay Date: Mon, 21 Nov 2016 19:43:59 -0800 Subject: Add temporary morden explorer link support --- test/unit/account-link-test.js | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'test/unit') diff --git a/test/unit/account-link-test.js b/test/unit/account-link-test.js index 08d190f71..5036f8f5d 100644 --- a/test/unit/account-link-test.js +++ b/test/unit/account-link-test.js @@ -3,6 +3,12 @@ var linkGen = require('../../ui/lib/account-link') describe('account-link', function() { + it('adds morden prefix to morden test network', function() { + var result = linkGen('account', '2') + assert.notEqual(result.indexOf('morden'), -1, 'testnet injected') + assert.notEqual(result.indexOf('account'), -1, 'account included') + }) + it('adds testnet prefix to ropsten test network', function() { var result = linkGen('account', '3') assert.notEqual(result.indexOf('testnet'), -1, 'testnet injected') -- cgit v1.2.3 From e2a9e1cd4ab6329df3de94d136ccb7e912945c48 Mon Sep 17 00:00:00 2001 From: Dan Finlay Date: Mon, 21 Nov 2016 19:45:05 -0800 Subject: Unify test wording --- test/unit/account-link-test.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'test/unit') diff --git a/test/unit/account-link-test.js b/test/unit/account-link-test.js index 5036f8f5d..4ea12e002 100644 --- a/test/unit/account-link-test.js +++ b/test/unit/account-link-test.js @@ -5,13 +5,13 @@ describe('account-link', function() { it('adds morden prefix to morden test network', function() { var result = linkGen('account', '2') - assert.notEqual(result.indexOf('morden'), -1, 'testnet injected') + assert.notEqual(result.indexOf('morden'), -1, 'testnet included') assert.notEqual(result.indexOf('account'), -1, 'account included') }) it('adds testnet prefix to ropsten test network', function() { var result = linkGen('account', '3') - assert.notEqual(result.indexOf('testnet'), -1, 'testnet injected') + assert.notEqual(result.indexOf('testnet'), -1, 'testnet included') assert.notEqual(result.indexOf('account'), -1, 'account included') }) -- cgit v1.2.3 From fa2f0dee285d4a9032f8a756ee8711a7fe767b76 Mon Sep 17 00:00:00 2001 From: kumavis Date: Tue, 22 Nov 2016 12:10:49 -0800 Subject: idStore - fix estimateGas calculation --- test/unit/idStore-test.js | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'test/unit') diff --git a/test/unit/idStore-test.js b/test/unit/idStore-test.js index 064483ba0..bf8270540 100644 --- a/test/unit/idStore-test.js +++ b/test/unit/idStore-test.js @@ -152,11 +152,9 @@ describe('IdentityStore', function() { const gas = '0x01' const bnGas = new BN(gas, 16) - const result = idStore.addGasBuffer(gas) - const bnResult = new BN(result, 16) + const bnResult = idStore.addGasBuffer(bnGas) assert.ok(bnResult.gt(gas), 'added more gas as buffer.') - assert.equal(result.indexOf('0x'), 0, 'include hex prefix') }) it('buffers 20%', function() { @@ -173,13 +171,10 @@ describe('IdentityStore', function() { const correctBuffer = bnGas.div(five) const correct = bnGas.add(correctBuffer) - const result = idStore.addGasBuffer(gas) - const bnResult = new BN(ethUtil.stripHexPrefix(result), 16) + const bnResult = idStore.addGasBuffer(bnGas) - assert.equal(result.indexOf('0x'), 0, 'included hex prefix') assert(bnResult.gt(bnGas), 'Estimate increased in value.') assert.equal(bnResult.sub(bnGas).toString(10), correctBuffer.toString(10), 'added 20% gas') - assert.equal(result, '0x' + correct.toString(16), 'Added the right amount') }) }) -- cgit v1.2.3