1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-23 18:41:38 +01:00
metamask-extension/ui/helpers/utils/tx-helper.test.js
2022-09-14 09:55:31 -05:00

19 lines
604 B
JavaScript

import { CHAIN_IDS, NETWORK_IDS } from '../../../shared/constants/network';
import txHelper from './tx-helper';
describe('txHelper', () => {
it('always shows the oldest tx first', () => {
const metamaskNetworkId = NETWORK_IDS.MAINNET;
const chainId = CHAIN_IDS.MAINNET;
const txs = {
a: { metamaskNetworkId, time: 3 },
b: { metamaskNetworkId, time: 1 },
c: { metamaskNetworkId, time: 2 },
};
const sorted = txHelper(txs, null, null, metamaskNetworkId, chainId);
expect(sorted[0].time).toStrictEqual(1);
expect(sorted[2].time).toStrictEqual(3);
});
});