2021-04-15 20:01:46 +02:00
|
|
|
/* eslint-disable import/unambiguous */
|
2021-02-04 19:15:23 +01:00
|
|
|
let mapStateToProps;
|
2018-10-17 01:03:29 +02:00
|
|
|
|
2021-04-15 20:01:46 +02:00
|
|
|
jest.mock('react-redux', () => ({
|
|
|
|
connect: (ms) => {
|
|
|
|
mapStateToProps = ms;
|
|
|
|
return () => ({});
|
2018-10-17 01:03:29 +02:00
|
|
|
},
|
2021-04-15 20:01:46 +02:00
|
|
|
}));
|
|
|
|
|
2022-07-27 21:32:17 +02:00
|
|
|
require('./user-preferenced-currency-input.container');
|
2018-10-17 01:03:29 +02:00
|
|
|
|
2021-04-15 20:01:46 +02:00
|
|
|
describe('UserPreferencedCurrencyInput container', () => {
|
|
|
|
describe('mapStateToProps()', () => {
|
|
|
|
it('should return the correct props', () => {
|
2018-10-17 01:03:29 +02:00
|
|
|
const mockState = {
|
|
|
|
metamask: {
|
|
|
|
preferences: {
|
2018-10-26 10:26:43 +02:00
|
|
|
useNativeCurrencyAsPrimaryCurrency: true,
|
2018-10-17 01:03:29 +02:00
|
|
|
},
|
|
|
|
},
|
2022-01-20 16:42:13 +01:00
|
|
|
appState: {
|
|
|
|
sendInputCurrencySwitched: false,
|
|
|
|
},
|
2021-02-04 19:15:23 +01:00
|
|
|
};
|
2021-04-15 20:01:46 +02:00
|
|
|
expect(mapStateToProps(mockState)).toStrictEqual({
|
2018-10-26 10:26:43 +02:00
|
|
|
useNativeCurrencyAsPrimaryCurrency: true,
|
2022-01-20 16:42:13 +01:00
|
|
|
sendInputCurrencySwitched: false,
|
2021-02-04 19:15:23 +01:00
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|