aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app
diff options
context:
space:
mode:
authorWhymarrh Whitby <whymarrh.whitby@gmail.com>2018-09-27 22:19:21 +0800
committerWhymarrh Whitby <whymarrh.whitby@gmail.com>2018-10-01 23:23:32 +0800
commit3741927d8d63bbee1eb9a628d2aac4c8e2e67f99 (patch)
tree1e49047dbd03b5ebb272b16516c8ac30937e11a8 /ui/app
parent508a712479d847ba90428e65989455c6f67b727d (diff)
downloadtangerine-wallet-browser-3741927d8d63bbee1eb9a628d2aac4c8e2e67f99.tar
tangerine-wallet-browser-3741927d8d63bbee1eb9a628d2aac4c8e2e67f99.tar.gz
tangerine-wallet-browser-3741927d8d63bbee1eb9a628d2aac4c8e2e67f99.tar.bz2
tangerine-wallet-browser-3741927d8d63bbee1eb9a628d2aac4c8e2e67f99.tar.lz
tangerine-wallet-browser-3741927d8d63bbee1eb9a628d2aac4c8e2e67f99.tar.xz
tangerine-wallet-browser-3741927d8d63bbee1eb9a628d2aac4c8e2e67f99.tar.zst
tangerine-wallet-browser-3741927d8d63bbee1eb9a628d2aac4c8e2e67f99.zip
Update send.utils.test to with better mocks
Diffstat (limited to 'ui/app')
-rw-r--r--ui/app/components/send/tests/send-utils.test.js13
1 files changed, 8 insertions, 5 deletions
diff --git a/ui/app/components/send/tests/send-utils.test.js b/ui/app/components/send/tests/send-utils.test.js
index 18dde495a..3d983a5dc 100644
--- a/ui/app/components/send/tests/send-utils.test.js
+++ b/ui/app/components/send/tests/send-utils.test.js
@@ -304,10 +304,13 @@ describe('send utils', () => {
selectedAddress: 'mockAddress',
to: '0xisContract',
estimateGasMethod: sinon.stub().callsFake(
- (data, cb) => cb(
- data.to.match(/willFailBecauseOf:/) ? { message: data.to.match(/:(.+)$/)[1] } : null,
- { toString: (n) => `0xabc${n}` }
- )
+ ({to}, cb) => {
+ const err = typeof to === 'string' && to.match(/willFailBecauseOf:/)
+ ? new Error(to.match(/:(.+)$/)[1])
+ : null
+ const result = { toString: (n) => `0xabc${n}` }
+ return cb(err, result)
+ }
),
}
const baseExpectedCall = {
@@ -407,7 +410,7 @@ describe('send utils', () => {
to: 'isContract willFailBecauseOf:some other error',
}))
} catch (err) {
- assert.deepEqual(err, { message: 'some other error' })
+ assert.equal(err.message, 'some other error')
}
})
})