1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-26 12:29:06 +01:00
metamask-extension/ui/components/app/transaction-activity-log/transaction-activity-log.container.test.js

64 lines
1.6 KiB
JavaScript
Raw Normal View History

/* eslint-disable import/unambiguous */
let mapStateToProps;
jest.mock('react-redux', () => ({
connect: (ms) => {
mapStateToProps = ms;
return () => ({});
},
}));
require('./transaction-activity-log.container');
describe('TransactionActivityLog container', () => {
describe('mapStateToProps()', () => {
it('should return the correct props', () => {
const mockState = {
metamask: {
conversionRate: 280.45,
nativeCurrency: 'ETH',
networkConfigurations: {},
providerConfig: {
ticker: 'ETH',
},
},
};
expect(mapStateToProps(mockState)).toStrictEqual({
2020-11-03 00:41:28 +01:00
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',
networkConfigurations: {
networkConfigurationId: {
rpcUrl: 'https://customnetwork.com/',
},
},
providerConfig: {
rpcUrl: 'https://customnetwork.com/',
ticker: 'ETH',
rpcPrefs: {
blockExplorerUrl: 'https://customblockexplorer.com/',
},
},
},
};
expect(mapStateToProps(mockState)).toStrictEqual({
conversionRate: 280.45,
nativeCurrency: 'ETH',
rpcPrefs: {
blockExplorerUrl: 'https://customblockexplorer.com/',
},
});
});
});
});