1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-23 18:41:38 +01:00
metamask-extension/ui/components/app/transaction-activity-log/transaction-activity-log.container.test.js
2021-06-06 12:45:27 -02:30

60 lines
1.4 KiB
JavaScript

/* eslint-disable import/unambiguous */
let mapStateToProps;
jest.mock('react-redux', () => ({
connect: (ms) => {
mapStateToProps = ms;
return () => ({});
},
}));
require('./transaction-activity-log.container.js');
describe('TransactionActivityLog container', () => {
describe('mapStateToProps()', () => {
it('should return the correct props', () => {
const mockState = {
metamask: {
conversionRate: 280.45,
nativeCurrency: 'ETH',
frequentRpcListDetail: [],
},
};
expect(mapStateToProps(mockState)).toStrictEqual({
conversionRate: 280.45,
nativeCurrency: 'ETH',
rpcPrefs: {},
});
});
it('should return the correct props when on a custom network', () => {
const mockState = {
metamask: {
conversionRate: 280.45,
nativeCurrency: 'ETH',
frequentRpcListDetail: [
{
rpcUrl: 'https://customnetwork.com/',
rpcPrefs: {
blockExplorerUrl: 'https://customblockexplorer.com/',
},
},
],
provider: {
rpcUrl: 'https://customnetwork.com/',
},
},
};
expect(mapStateToProps(mockState)).toStrictEqual({
conversionRate: 280.45,
nativeCurrency: 'ETH',
rpcPrefs: {
blockExplorerUrl: 'https://customblockexplorer.com/',
},
});
});
});
});