aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkumavis <aaron@kumavis.me>2017-10-03 06:20:18 +0800
committerkumavis <aaron@kumavis.me>2017-10-03 06:20:18 +0800
commit25a80932a64f718ba1a39ab399b17395f0fd5d88 (patch)
treefed1cd808133c642526941050fa82f4f4ad5b823
parented77304e73e91f252e6e0a3f682569ad17a0d52d (diff)
downloadtangerine-wallet-browser-25a80932a64f718ba1a39ab399b17395f0fd5d88.tar
tangerine-wallet-browser-25a80932a64f718ba1a39ab399b17395f0fd5d88.tar.gz
tangerine-wallet-browser-25a80932a64f718ba1a39ab399b17395f0fd5d88.tar.bz2
tangerine-wallet-browser-25a80932a64f718ba1a39ab399b17395f0fd5d88.tar.lz
tangerine-wallet-browser-25a80932a64f718ba1a39ab399b17395f0fd5d88.tar.xz
tangerine-wallet-browser-25a80932a64f718ba1a39ab399b17395f0fd5d88.tar.zst
tangerine-wallet-browser-25a80932a64f718ba1a39ab399b17395f0fd5d88.zip
pending tx tracker - test - expect warning event on resubmit failure
-rw-r--r--test/unit/pending-tx-test.js11
1 files changed, 9 insertions, 2 deletions
diff --git a/test/unit/pending-tx-test.js b/test/unit/pending-tx-test.js
index 097564033..6b62bb5b1 100644
--- a/test/unit/pending-tx-test.js
+++ b/test/unit/pending-tx-test.js
@@ -199,8 +199,15 @@ describe('PendingTransactionTracker', function () {
pendingTxTracker.resubmitPendingTxs()
})
- it('should emit \'tx:failed\' if it encountered a real error', function (done) {
- pendingTxTracker.once('tx:failed', (id, err) => err.message === 'im some real error' ? txList[id - 1].resolve() : done(err))
+ it('should emit \'tx:warning\' if it encountered a real error', function (done) {
+ pendingTxTracker.once('tx:warning', (txMeta, err) => {
+ if (err.message === 'im some real error') {
+ const matchingTx = txList.find(tx => tx.id === txMeta.id)
+ matchingTx.resolve()
+ } else {
+ done(err)
+ }
+ })
pendingTxTracker.getPendingTransactions = () => txList
pendingTxTracker._resubmitTx = async (tx) => { throw new TypeError('im some real error') }