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.
Tag:
Branch:
Tree:
79e79e9212
develop
feature/default_network_editable
v10.22.3
${ noResults }
60 lines
1.4 KiB
60 lines
1.4 KiB
/* 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/',
|
|||
},
|
|||
});
|
|||
});
|
|||
});
|
|||
});
|