mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-11-27 12:56:01 +01:00
614501e743
Newest tx or message will now always appear last, and a new tx proposed after the user has a confirmation box open will never change the confirmation to a different tx proposed. Fixes #1637
18 lines
536 B
JavaScript
18 lines
536 B
JavaScript
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')
|
|
})
|
|
})
|