aboutsummaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
authorAlexander Tseung <alextsg@gmail.com>2018-08-24 10:19:48 +0800
committerAlexander Tseung <alextsg@gmail.com>2018-08-24 10:19:48 +0800
commitc0e97d17393c9ce5024af8626c1bafc5d5b4efe4 (patch)
treedbe6a7883f5851aaef0229674296eeadd34b4bcb /ui
parent342522c6cf23670f931e69ba822eedfd2d6ee252 (diff)
downloadtangerine-wallet-browser-c0e97d17393c9ce5024af8626c1bafc5d5b4efe4.tar
tangerine-wallet-browser-c0e97d17393c9ce5024af8626c1bafc5d5b4efe4.tar.gz
tangerine-wallet-browser-c0e97d17393c9ce5024af8626c1bafc5d5b4efe4.tar.bz2
tangerine-wallet-browser-c0e97d17393c9ce5024af8626c1bafc5d5b4efe4.tar.lz
tangerine-wallet-browser-c0e97d17393c9ce5024af8626c1bafc5d5b4efe4.tar.xz
tangerine-wallet-browser-c0e97d17393c9ce5024af8626c1bafc5d5b4efe4.tar.zst
tangerine-wallet-browser-c0e97d17393c9ce5024af8626c1bafc5d5b4efe4.zip
Fix tests
Diffstat (limited to 'ui')
-rw-r--r--ui/app/components/transaction-action/tests/transaction-action.component.test.js14
1 files changed, 12 insertions, 2 deletions
diff --git a/ui/app/components/transaction-action/tests/transaction-action.component.test.js b/ui/app/components/transaction-action/tests/transaction-action.component.test.js
index 158bc8dc4..218792847 100644
--- a/ui/app/components/transaction-action/tests/transaction-action.component.test.js
+++ b/ui/app/components/transaction-action/tests/transaction-action.component.test.js
@@ -1,10 +1,18 @@
import React from 'react'
import assert from 'assert'
import { shallow } from 'enzyme'
+import sinon from 'sinon'
import TransactionAction from '../transaction-action.component'
describe('TransactionAction Component', () => {
const tOrDefault = key => key
+ global.eth = {
+ getCode: sinon.stub().callsFake(address => {
+ console.log('CALLED')
+ const code = address === 'approveAddress' ? 'contract' : '0x'
+ return Promise.resolve(code)
+ }),
+ }
describe('Outgoing transaction', () => {
it('should render -- when methodData is still fetching', () => {
@@ -46,7 +54,7 @@ describe('TransactionAction Component', () => {
gas: '0x5208',
gasPrice: '0x3b9aca00',
nonce: '0x96',
- to: '0x50a9d56c2b8ba9a5c7f2c08c3d26e0499f23a706',
+ to: 'sentEtherAddress',
value: '0x2386f26fc10000',
},
}
@@ -58,6 +66,7 @@ describe('TransactionAction Component', () => {
/>, { context: { tOrDefault }})
assert.equal(wrapper.find('.transaction-action').length, 1)
+ wrapper.setState({ transactionAction: 'sentEther' })
assert.equal(wrapper.text(), 'sentEther')
})
@@ -83,7 +92,7 @@ describe('TransactionAction Component', () => {
gas: '0x5208',
gasPrice: '0x3b9aca00',
nonce: '0x96',
- to: '0x50a9d56c2b8ba9a5c7f2c08c3d26e0499f23a706',
+ to: 'approveAddress',
value: '0x2386f26fc10000',
data: '0x095ea7b300000000000000000000000050a9d56c2b8ba9a5c7f2c08c3d26e0499f23a7060000000000000000000000000000000000000000000000000000000000000003',
},
@@ -96,6 +105,7 @@ describe('TransactionAction Component', () => {
/>, { context: { tOrDefault }})
assert.equal(wrapper.find('.transaction-action').length, 1)
+ wrapper.setState({ transactionAction: 'approve' })
assert.equal(wrapper.text(), 'approve')
})
})