diff options
author | kumavis <kumavis@users.noreply.github.com> | 2017-07-19 00:34:02 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-07-19 00:34:02 +0800 |
commit | 1e718505824f5ee566138edb6de1f914397100b6 (patch) | |
tree | a560ddc4fb5cc34ec1fa7c17e2c2b8f177c84f6c /test/unit/tx-helper-test.js | |
parent | e083e775858f2da16f7508229f20aaac83f1eb20 (diff) | |
parent | 614501e743a0c1584062c78a25e6b9a3ddf10aab (diff) | |
download | tangerine-wallet-browser-1e718505824f5ee566138edb6de1f914397100b6.tar tangerine-wallet-browser-1e718505824f5ee566138edb6de1f914397100b6.tar.gz tangerine-wallet-browser-1e718505824f5ee566138edb6de1f914397100b6.tar.bz2 tangerine-wallet-browser-1e718505824f5ee566138edb6de1f914397100b6.tar.lz tangerine-wallet-browser-1e718505824f5ee566138edb6de1f914397100b6.tar.xz tangerine-wallet-browser-1e718505824f5ee566138edb6de1f914397100b6.tar.zst tangerine-wallet-browser-1e718505824f5ee566138edb6de1f914397100b6.zip |
Merge pull request #1787 from MetaMask/i1637-TransactionOrder
Fix transaction confirmation ordering
Diffstat (limited to 'test/unit/tx-helper-test.js')
-rw-r--r-- | test/unit/tx-helper-test.js | 17 |
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') + }) +}) |