You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
18 lines
545 B
18 lines
545 B
7 years ago
|
const assert = require('assert')
|
||
7 years ago
|
const txHelper = require('../../../../../ui/lib/tx-helper')
|
||
7 years ago
|
|
||
|
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')
|
||
|
})
|
||
|
})
|