aboutsummaryrefslogtreecommitdiffstats
path: root/test/unit/tx-helper-test.js
diff options
context:
space:
mode:
authorDan Finlay <dan@danfinlay.com>2017-07-21 03:39:06 +0800
committerDan Finlay <dan@danfinlay.com>2017-07-21 03:39:06 +0800
commita41e5788cf4a8e680fdbc4d16690a8f5cc8af265 (patch)
tree5c546e149ce0cf2d88bbef1d1645b124f11d0eb5 /test/unit/tx-helper-test.js
parent86d367957fe8ac04462f716fe0ba2bfa4e5ff3f6 (diff)
parent9b24ab0e70d72471ddc928a763bc2096790ab966 (diff)
downloadtangerine-wallet-browser-a41e5788cf4a8e680fdbc4d16690a8f5cc8af265.tar
tangerine-wallet-browser-a41e5788cf4a8e680fdbc4d16690a8f5cc8af265.tar.gz
tangerine-wallet-browser-a41e5788cf4a8e680fdbc4d16690a8f5cc8af265.tar.bz2
tangerine-wallet-browser-a41e5788cf4a8e680fdbc4d16690a8f5cc8af265.tar.lz
tangerine-wallet-browser-a41e5788cf4a8e680fdbc4d16690a8f5cc8af265.tar.xz
tangerine-wallet-browser-a41e5788cf4a8e680fdbc4d16690a8f5cc8af265.tar.zst
tangerine-wallet-browser-a41e5788cf4a8e680fdbc4d16690a8f5cc8af265.zip
Merge branch 'master' into NewUI
Diffstat (limited to 'test/unit/tx-helper-test.js')
-rw-r--r--test/unit/tx-helper-test.js17
1 files changed, 17 insertions, 0 deletions
diff --git a/test/unit/tx-helper-test.js b/test/unit/tx-helper-test.js
new file mode 100644
index 000000000..cc6543c30
--- /dev/null
+++ b/test/unit/tx-helper-test.js
@@ -0,0 +1,17 @@
+const assert = require('assert')
+const txHelper = require('../../ui/lib/tx-helper')
+
+describe('txHelper', function () {
+ it('always shows the oldest tx first', function () {
+ const metamaskNetworkId = 1
+ const txs = {
+ a: { metamaskNetworkId, time: 3 },
+ b: { metamaskNetworkId, time: 1 },
+ c: { metamaskNetworkId, time: 2 },
+ }
+
+ const sorted = txHelper(txs, null, null, metamaskNetworkId)
+ assert.equal(sorted[0].time, 1, 'oldest tx first')
+ assert.equal(sorted[2].time, 3, 'newest tx last')
+ })
+})