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