mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-02 22:24:27 +01:00
652db3fd36
* convert network id enums to string * stringify appropriate chain/network ids in tests Co-authored-by: Mark Stacey <markjstacey@gmail.com>
18 lines
551 B
JavaScript
18 lines
551 B
JavaScript
import { strict as assert } from 'assert'
|
|
import txHelper from '../../../../../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')
|
|
})
|
|
})
|