mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
Verify updating gas value updates
This commit is contained in:
parent
4b341e6a95
commit
75d9b5619c
@ -7,6 +7,7 @@ const React = require('react')
|
|||||||
const shallow = require('react-test-renderer/shallow')
|
const shallow = require('react-test-renderer/shallow')
|
||||||
const Factory = createReactFactory(PendingTx)
|
const Factory = createReactFactory(PendingTx)
|
||||||
const ReactTestUtils = require('react-addons-test-utils')
|
const ReactTestUtils = require('react-addons-test-utils')
|
||||||
|
const ethUtil = require('ethereumjs-util')
|
||||||
|
|
||||||
describe.only('PendingTx', function () {
|
describe.only('PendingTx', function () {
|
||||||
let pendingTxComponent
|
let pendingTxComponent
|
||||||
@ -38,15 +39,16 @@ describe.only('PendingTx', function () {
|
|||||||
it('should use updated values when edited.', function (done) {
|
it('should use updated values when edited.', function (done) {
|
||||||
|
|
||||||
const renderer = ReactTestUtils.createRenderer();
|
const renderer = ReactTestUtils.createRenderer();
|
||||||
const newGasPrice = '0x451456'
|
const newGasPrice = '0x77359400'
|
||||||
|
|
||||||
const props = {
|
const props = {
|
||||||
identities,
|
identities,
|
||||||
accounts: identities,
|
accounts: identities,
|
||||||
txData,
|
txData,
|
||||||
sendTransaction: (txMeta, event) => {
|
sendTransaction: (txMeta, event) => {
|
||||||
assert.notEqual(txMeta.txParams.gasPrice, gasPrice, 'gas price should change')
|
const result = ethUtil.addHexPrefix(txMeta.txParams.gasPrice)
|
||||||
assert.equal(txMeta.txParams.gasPrice, newGasPrice, 'gas price assigned.')
|
assert.notEqual(result, gasPrice, 'gas price should change')
|
||||||
|
assert.equal(result, newGasPrice, 'gas price assigned.')
|
||||||
done()
|
done()
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
@ -381,8 +381,6 @@ PendingTx.prototype.onSubmit = function (event) {
|
|||||||
|
|
||||||
PendingTx.prototype.checkValidity = function() {
|
PendingTx.prototype.checkValidity = function() {
|
||||||
const form = this.getFormEl()
|
const form = this.getFormEl()
|
||||||
console.log("check validity got form el:")
|
|
||||||
console.dir(form)
|
|
||||||
const valid = form.checkValidity()
|
const valid = form.checkValidity()
|
||||||
return valid
|
return valid
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user