aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorDan Finlay <dan@danfinlay.com>2017-05-12 08:09:23 +0800
committerDan Finlay <dan@danfinlay.com>2017-05-12 08:09:23 +0800
commit60746a985997693612af0c8b43aac95b2a6e56e6 (patch)
treeeeca43dcd621f5cd7ca1009b6aa0d848231e9094 /test
parent16005ebd3a7db5c48f9d81d5a1c77ace7ff92958 (diff)
downloadtangerine-wallet-browser-60746a985997693612af0c8b43aac95b2a6e56e6.tar
tangerine-wallet-browser-60746a985997693612af0c8b43aac95b2a6e56e6.tar.gz
tangerine-wallet-browser-60746a985997693612af0c8b43aac95b2a6e56e6.tar.bz2
tangerine-wallet-browser-60746a985997693612af0c8b43aac95b2a6e56e6.tar.lz
tangerine-wallet-browser-60746a985997693612af0c8b43aac95b2a6e56e6.tar.xz
tangerine-wallet-browser-60746a985997693612af0c8b43aac95b2a6e56e6.tar.zst
tangerine-wallet-browser-60746a985997693612af0c8b43aac95b2a6e56e6.zip
Use react test utils to start composing test
Diffstat (limited to 'test')
-rw-r--r--test/unit/components/pending-tx-test.js25
1 files changed, 19 insertions, 6 deletions
diff --git a/test/unit/components/pending-tx-test.js b/test/unit/components/pending-tx-test.js
index b798865cc..caaf66b49 100644
--- a/test/unit/components/pending-tx-test.js
+++ b/test/unit/components/pending-tx-test.js
@@ -1,5 +1,13 @@
var assert = require('assert')
+const h = require('react-hyperscript')
var PendingTx = require('../../../ui/app/components/pending-tx')
+const createReactFactory = require('create-react-factory').createReactFactory
+const React = require('react')
+console.dir(createReactFactory)
+const shallow = require('enzyme').shallow
+const Factory = createReactFactory(PendingTx)
+const ReactTestUtils = require('react-addons-test-utils')
+const renderer = ReactTestUtils.createRenderer();
describe.only('PendingTx', function () {
let pendingTxComponent
@@ -43,14 +51,21 @@ describe.only('PendingTx', function () {
},
}
- pendingTxComponent = new PendingTx(props)
+ const pendingTxComponent = h(PendingTx, props)
+ renderer.render(pendingTxComponent)
+ console.dir(pendingTxComponent)
const noop = () => {}
setTimeout(() => {
- console.log('component mounted')
+ console.log('timeout finished')
- pendingTxComponent.gasPriceChanged(newGasPrice)
+ // Get the gas price input
+ // Set it to the newGasPrice value
+ // Wait for the value to change
+ // Get the submit button
+ // Click the submit button
+ // Get the output of the submit event.
setTimeout(() => {
console.log('hitting submit')
@@ -59,9 +74,7 @@ describe.only('PendingTx', function () {
}, 200)
console.log('calling render')
- pendingTxComponent.props = props
- pendingTxComponent.checkValidity = () => { return true }
- pendingTxComponent.render()
})
})
+