From 9b92ba4c47d5489c5c0f822045360be708110cac Mon Sep 17 00:00:00 2001 From: frankiebee Date: Mon, 25 Jun 2018 15:07:54 -0700 Subject: trandsactions - remove rejected transactions from history --- .../app/controllers/transactions/tx-state-manager-test.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'test/unit/app/controllers/transactions') diff --git a/test/unit/app/controllers/transactions/tx-state-manager-test.js b/test/unit/app/controllers/transactions/tx-state-manager-test.js index 20bc08b94..f2d0175cb 100644 --- a/test/unit/app/controllers/transactions/tx-state-manager-test.js +++ b/test/unit/app/controllers/transactions/tx-state-manager-test.js @@ -288,4 +288,18 @@ describe('TransactionStateManager', function () { }) }) + + describe.only('#_removeTx', function () { + it('should remove the transaction from the storage', () => { + txStateManager._saveTxList([ {id: 1} ]) + txStateManager._removeTx(1) + assert(!txStateManager.getFullTxList().length, 'txList should be empty') + }) + + it('should only remove the transaction with ID 1 from the storage', () => { + txStateManager._saveTxList([ {id: 1}, {id: 2} ]) + txStateManager._removeTx(1) + assert.equal(txStateManager.getFullTxList()[0].id, 2, 'txList should have a id of 2') + }) + }) }) -- cgit