From 13ebb0b455bc775a53b6bb30e675a39d02d8f6f5 Mon Sep 17 00:00:00 2001 From: tmashuang Date: Mon, 21 May 2018 05:59:26 -0700 Subject: Moved loose some loose test files to sub folders --- .../unit/app/controllers/transactions/tx-helper-test.js | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 test/unit/app/controllers/transactions/tx-helper-test.js (limited to 'test/unit/app/controllers/transactions/tx-helper-test.js') 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') + }) +}) -- cgit