1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-23 01:39:44 +01:00

Fix test to call done

This commit is contained in:
frankiebee 2017-06-15 15:25:22 -07:00
parent b3492d9c17
commit b67bc7043e

View File

@ -270,26 +270,28 @@ describe('Transaction Controller', function () {
it('does not overwrite set values', function (done) {
this.timeout(15000)
const wrongValue = '0x05'
txController.addTx(txMeta)
const estimateStub = sinon.stub(txController.txProviderUtils.query, 'estimateGas')
.callsArgWith(1, null, wrongValue)
.callsArgWithAsync(1, null, wrongValue)
const priceStub = sinon.stub(txController.txProviderUtils.query, 'gasPrice')
.callsArgWith(0, null, wrongValue)
.callsArgWithAsync(0, null, wrongValue)
const nonceStub = sinon.stub(txController.txProviderUtils.query, 'getTransactionCount')
.callsArgWith(2, null, wrongValue)
.callsArgWithAsync(2, null, wrongValue)
const signStub = sinon.stub(txController, 'signTransaction')
.callsArgWith(1, null, noop)
.callsArgWithAsync(1, null, noop)
const pubStub = sinon.stub(txController.txProviderUtils, 'publishTransaction')
.callsArgWith(1, null, originalValue)
.callsArgWithAsync(1, null, originalValue)
console.log('HERE !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!')
txController.approveTransaction(txMeta.id, (err) => {
txController.approveTransaction(txMeta.id).then((err) => {
assert.ifError(err, 'should not error')
const result = txController.getTx(txMeta.id)
@ -305,7 +307,6 @@ describe('Transaction Controller', function () {
signStub.restore()
nonceStub.restore()
pubStub.restore()
done()
})
})