1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-27 12:56:01 +01:00
metamask-extension/test/unit/app/controllers/transactions/tx-helper-test.js
Erik Marks 76a2a9bb8b
@metamask/eslint config@5.0.0 (#10358)
* @metamask/eslint-config@5.0.0
* Update eslintrc and prettierrc
* yarn lint:fix
2021-02-04 10:15:23 -08:00

18 lines
560 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');
});
});