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.
22 lines
621 B
22 lines
621 B
4 years ago
|
import {
|
||
|
MAINNET_CHAIN_ID,
|
||
|
MAINNET_NETWORK_ID,
|
||
4 years ago
|
} from '../../../shared/constants/network';
|
||
4 years ago
|
import txHelper from './tx-helper';
|
||
7 years ago
|
|
||
4 years ago
|
describe('txHelper', () => {
|
||
|
it('always shows the oldest tx first', () => {
|
||
4 years ago
|
const metamaskNetworkId = MAINNET_NETWORK_ID;
|
||
|
const chainId = MAINNET_CHAIN_ID;
|
||
7 years ago
|
const txs = {
|
||
|
a: { metamaskNetworkId, time: 3 },
|
||
|
b: { metamaskNetworkId, time: 1 },
|
||
|
c: { metamaskNetworkId, time: 2 },
|
||
4 years ago
|
};
|
||
7 years ago
|
|
||
4 years ago
|
const sorted = txHelper(txs, null, null, metamaskNetworkId, chainId);
|
||
4 years ago
|
expect(sorted[0].time).toStrictEqual(1);
|
||
|
expect(sorted[2].time).toStrictEqual(3);
|
||
4 years ago
|
});
|
||
|
});
|