aboutsummaryrefslogtreecommitdiffstats
path: root/test/unit
diff options
context:
space:
mode:
authorfrankiebee <frankie.diamond@gmail.com>2018-06-26 06:07:54 +0800
committerfrankiebee <frankie.diamond@gmail.com>2018-06-26 06:07:54 +0800
commit9b92ba4c47d5489c5c0f822045360be708110cac (patch)
treef73fe1beed9cdc4dd4295a2d5a4579205a391dc4 /test/unit
parent7d3da0ae96a761461ee12bf20d8386a5ba7aade2 (diff)
downloadtangerine-wallet-browser-9b92ba4c47d5489c5c0f822045360be708110cac.tar
tangerine-wallet-browser-9b92ba4c47d5489c5c0f822045360be708110cac.tar.gz
tangerine-wallet-browser-9b92ba4c47d5489c5c0f822045360be708110cac.tar.bz2
tangerine-wallet-browser-9b92ba4c47d5489c5c0f822045360be708110cac.tar.lz
tangerine-wallet-browser-9b92ba4c47d5489c5c0f822045360be708110cac.tar.xz
tangerine-wallet-browser-9b92ba4c47d5489c5c0f822045360be708110cac.tar.zst
tangerine-wallet-browser-9b92ba4c47d5489c5c0f822045360be708110cac.zip
trandsactions - remove rejected transactions from history
Diffstat (limited to 'test/unit')
-rw-r--r--test/unit/app/controllers/transactions/tx-state-manager-test.js14
1 files changed, 14 insertions, 0 deletions
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')
+ })
+ })
})