diff options
author | kumavis <kumavis@users.noreply.github.com> | 2017-05-17 14:49:19 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-05-17 14:49:19 +0800 |
commit | 965a72486ff8745e86cd81a93c880904416d4c58 (patch) | |
tree | 04a87c708baa3123cc56935eaa95f220f1e08bcf /test/unit/components | |
parent | 43ea223c9fe8ee593a572b153defc5ddefd72e95 (diff) | |
parent | 31c7daee73fa41e356d1bd5cd92186e60b252212 (diff) | |
download | tangerine-wallet-browser-965a72486ff8745e86cd81a93c880904416d4c58.tar tangerine-wallet-browser-965a72486ff8745e86cd81a93c880904416d4c58.tar.gz tangerine-wallet-browser-965a72486ff8745e86cd81a93c880904416d4c58.tar.bz2 tangerine-wallet-browser-965a72486ff8745e86cd81a93c880904416d4c58.tar.lz tangerine-wallet-browser-965a72486ff8745e86cd81a93c880904416d4c58.tar.xz tangerine-wallet-browser-965a72486ff8745e86cd81a93c880904416d4c58.tar.zst tangerine-wallet-browser-965a72486ff8745e86cd81a93c880904416d4c58.zip |
Merge pull request #1441 from MetaMask/FixGasReset
Fix a test, add another
Diffstat (limited to 'test/unit/components')
-rw-r--r-- | test/unit/components/pending-tx-test.js | 28 |
1 files changed, 10 insertions, 18 deletions
diff --git a/test/unit/components/pending-tx-test.js b/test/unit/components/pending-tx-test.js index fe8290003..9ff948604 100644 --- a/test/unit/components/pending-tx-test.js +++ b/test/unit/components/pending-tx-test.js @@ -2,15 +2,10 @@ const assert = require('assert') const additions = require('react-testutils-additions') const h = require('react-hyperscript') const PendingTx = require('../../../ui/app/components/pending-tx') -const createReactFactory = require('create-react-factory').createReactFactory -const React = require('react') -const shallow = require('react-test-renderer/shallow') -const Factory = createReactFactory(PendingTx) const ReactTestUtils = require('react-addons-test-utils') const ethUtil = require('ethereumjs-util') -describe.only('PendingTx', function () { - let pendingTxComponent +describe('PendingTx', function () { const identities = { '0xfdea65c8e26263f6d9a1b5de9555d2931a33b826': { @@ -38,7 +33,7 @@ describe.only('PendingTx', function () { it('should use updated values when edited.', function (done) { - const renderer = ReactTestUtils.createRenderer(); + const renderer = ReactTestUtils.createRenderer() const newGasPrice = '0x77359400' const props = { @@ -56,34 +51,31 @@ describe.only('PendingTx', function () { } const pendingTxComponent = h(PendingTx, props) - const component = additions.renderIntoDocument(pendingTxComponent); + const component = additions.renderIntoDocument(pendingTxComponent) renderer.render(pendingTxComponent) const result = renderer.getRenderOutput() - const form = result.props.children - const children = form.props.children[form.props.children.length - 1] assert.equal(result.type, 'div', 'should create a div') - try{ - + try { const input = additions.find(component, '.cell.row input[type="number"]')[1] ReactTestUtils.Simulate.change(input, { target: { value: 2, checkValidity() { return true }, - } + }, }) - let form = additions.find(component, 'form')[0] + const form = additions.find(component, 'form')[0] form.checkValidity = () => true form.getFormEl = () => { return { checkValidity() { return true } } } - ReactTestUtils.Simulate.submit(form, { preventDefault() {}, target: { checkValidity() {return true} } }) + ReactTestUtils.Simulate.submit(form, { preventDefault() {}, target: { checkValidity() { + return true + } } }) } catch (e) { - console.log("WHAAAA") + console.log('WHAAAA') console.error(e) } - }) - }) |