1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-26 20:39:08 +01:00
metamask-extension/ui/components/app/transaction-activity-log/transaction-activity-log.container.test.js
Mark Stacey d1cea85f33
Rename provider to providerConfig (#18907)
* Rename `provider` to `providerConfig`

The network controller `provider` state has been renamed to
 `providerConfig`. This better reflects what this state is, and makes
this controller more closely aligned with the core network controller.

All references to the provider configuration have been updated to
prefer `providerConfig` over `provider`, to make the distinction clear
between a provider and provider config.

Closes #18902

* Add migration
2023-05-02 13:23:20 -02:30

64 lines
1.6 KiB
JavaScript

/* 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({
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/',
},
});
});
});
});