aboutsummaryrefslogtreecommitdiffstats
path: root/test/unit/app/controllers/transactions/tx-controller-test.js
diff options
context:
space:
mode:
authorDan Finlay <542863+danfinlay@users.noreply.github.com>2018-11-15 05:34:07 +0800
committerFrankie <frankie.diamond@gmail.com>2018-11-15 05:34:07 +0800
commit22ba0b0c2d4aee355893832dcbd9a5cd87cbf966 (patch)
tree077c21d0afb8e524b233622951ec822de0b22759 /test/unit/app/controllers/transactions/tx-controller-test.js
parentf6e042b7b12fec755b0a91ff24a1e812f65b638d (diff)
downloadtangerine-wallet-browser-22ba0b0c2d4aee355893832dcbd9a5cd87cbf966.tar.gz
tangerine-wallet-browser-22ba0b0c2d4aee355893832dcbd9a5cd87cbf966.tar.zst
tangerine-wallet-browser-22ba0b0c2d4aee355893832dcbd9a5cd87cbf966.zip
Resubmit approved transactions on new block (#5752)
* Add beginning of test * Resubmit approved transactions on new block May fix #4343 and related issues, where an error could leave transactions stranded in the approved state. * Remove unused test * Re-approve transactions when retrying approved * Add retry approved test * Include approved in pending tx count * Fix getPendingTxs() * Linted * Only throw hash error in submitted state * Only check submitted txs for block inclusion * Fix test expectations
Diffstat (limited to 'test/unit/app/controllers/transactions/tx-controller-test.js')
-rw-r--r--test/unit/app/controllers/transactions/tx-controller-test.js9
1 files changed, 6 insertions, 3 deletions
diff --git a/test/unit/app/controllers/transactions/tx-controller-test.js b/test/unit/app/controllers/transactions/tx-controller-test.js
index ea58aa560..7f1d8e6f5 100644
--- a/test/unit/app/controllers/transactions/tx-controller-test.js
+++ b/test/unit/app/controllers/transactions/tx-controller-test.js
@@ -313,6 +313,7 @@ describe('Transaction Controller', function () {
assert.equal(params.gas, originalValue, 'gas unmodified')
assert.equal(params.gasPrice, originalValue, 'gas price unmodified')
assert.equal(result.hash, originalValue, `hash was set \n got: ${result.hash} \n expected: ${originalValue}`)
+ assert.equal(result.status, 'submitted', 'Should have reached the submitted status.')
signStub.restore()
pubStub.restore()
done()
@@ -469,9 +470,11 @@ describe('Transaction Controller', function () {
{ id: 7, status: 'failed', metamaskNetworkId: currentNetworkId, txParams: {} },
])
})
- it('should show only submitted transactions as pending transasction', function () {
- assert(txController.pendingTxTracker.getPendingTransactions().length, 1)
- assert(txController.pendingTxTracker.getPendingTransactions()[0].status, 'submitted')
+ it('should show only submitted and approved transactions as pending transasction', function () {
+ assert(txController.pendingTxTracker.getPendingTransactions().length, 2)
+ const states = txController.pendingTxTracker.getPendingTransactions().map(tx => tx.status)
+ assert(states.includes('approved'), 'includes approved')
+ assert(states.includes('submitted'), 'includes submitted')
})
})
})