diff options
author | kumavis <kumavis@users.noreply.github.com> | 2018-05-23 04:02:41 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-05-23 04:02:41 +0800 |
commit | cee55b47d03006630b1dbe038c6008654ca8f674 (patch) | |
tree | fe818a80ee98ee76a53e9be6087c09be02241503 /test/unit/app/controllers/transactions/tx-helper-test.js | |
parent | 492b4a674392e4772ef8e2cc8f5836b882cfeec7 (diff) | |
parent | 238f2eb179895bbb9e2a2ec26863041564c90a9d (diff) | |
download | tangerine-wallet-browser-cee55b47d03006630b1dbe038c6008654ca8f674.tar.gz tangerine-wallet-browser-cee55b47d03006630b1dbe038c6008654ca8f674.tar.zst tangerine-wallet-browser-cee55b47d03006630b1dbe038c6008654ca8f674.zip |
Merge pull request #4321 from MetaMask/testing
MM controller tests and reorganizing test files
Diffstat (limited to 'test/unit/app/controllers/transactions/tx-helper-test.js')
-rw-r--r-- | test/unit/app/controllers/transactions/tx-helper-test.js | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/test/unit/app/controllers/transactions/tx-helper-test.js b/test/unit/app/controllers/transactions/tx-helper-test.js new file mode 100644 index 000000000..ce54ef483 --- /dev/null +++ b/test/unit/app/controllers/transactions/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') + }) +}) |