diff options
author | Kevin Serrano <kevin.serrano@consensys.net> | 2017-03-25 05:21:58 +0800 |
---|---|---|
committer | Kevin Serrano <kevin.serrano@consensys.net> | 2017-03-25 05:21:58 +0800 |
commit | 360afacd7093b16ae5dbfeb77a9f305e15b30297 (patch) | |
tree | 4353e8e9c502d47fe1bbd4762b3822b5d5d6ebf5 /test/unit | |
parent | 30e8d250138bef588d25619b9fc9563dbbb8ecac (diff) | |
download | tangerine-wallet-browser-360afacd7093b16ae5dbfeb77a9f305e15b30297.tar tangerine-wallet-browser-360afacd7093b16ae5dbfeb77a9f305e15b30297.tar.gz tangerine-wallet-browser-360afacd7093b16ae5dbfeb77a9f305e15b30297.tar.bz2 tangerine-wallet-browser-360afacd7093b16ae5dbfeb77a9f305e15b30297.tar.lz tangerine-wallet-browser-360afacd7093b16ae5dbfeb77a9f305e15b30297.tar.xz tangerine-wallet-browser-360afacd7093b16ae5dbfeb77a9f305e15b30297.tar.zst tangerine-wallet-browser-360afacd7093b16ae5dbfeb77a9f305e15b30297.zip |
Add tests.
Diffstat (limited to 'test/unit')
-rw-r--r-- | test/unit/tx-manager-test.js | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/test/unit/tx-manager-test.js b/test/unit/tx-manager-test.js index f64f048e3..2912a03d3 100644 --- a/test/unit/tx-manager-test.js +++ b/test/unit/tx-manager-test.js @@ -59,6 +59,17 @@ describe('Transaction Manager', function() { assert.equal(result[0].id, 1) }) + it('does not override txs from other networks', function() { + var tx = { id: 1, status: 'confirmed', metamaskNetworkId: 'unit test', txParams: {} } + var tx2 = { id: 2, status: 'confirmed', metamaskNetworkId: 'another net', txParams: {} } + txManager.addTx(tx, noop) + txManager.addTx(tx2, noop) + var result = txManager.getFullTxList() + var result2 = txManager.getTxList() + assert.equal(result.length, 2, 'txs were deleted') + assert.equal(result.length, 1, 'incorrect number of txs on network.') + }) + it('cuts off early txs beyond a limit', function() { const limit = txManager.txHistoryLimit for (let i = 0; i < limit + 1; i++) { |