add test for pendingTxCount

This commit is contained in:
frankiebee 2017-09-13 14:07:22 -07:00
parent 9e0c0745ab
commit 59909601b8
1 changed files with 13 additions and 0 deletions

View File

@ -59,6 +59,19 @@ describe('Transaction Controller', function () {
})
})
describe('#getPendingTxCount', function () {
it('should return the number of pending txs', function () {
txController.txStateManager._saveTxList([
{ id: 1, status: 'submitted', metamaskNetworkId: currentNetworkId, txParams: {} },
{ id: 2, status: 'submitted', metamaskNetworkId: currentNetworkId, txParams: {} },
{ id: 3, status: 'submitted', metamaskNetworkId: currentNetworkId, txParams: {} },
])
const pendingTxCount = txController.getPendingTxCount()
assert.equal(pendingTxCount, 3, 'should be 3')
})
})
describe('#newUnapprovedTransaction', function () {
let stub, txMeta, txParams
beforeEach(function () {