mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
Add tests.
This commit is contained in:
parent
30e8d25013
commit
360afacd70
@ -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++) {
|
||||
|
Loading…
Reference in New Issue
Block a user