2021-04-15 20:01:46 +02:00
|
|
|
// eslint-disable-next-line 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
|
|
|
}));
|
|
|
|
|
|
|
|
require('./user-preferenced-token-input.container.js');
|
2018-10-17 01:03:29 +02:00
|
|
|
|
2021-04-15 20:01:46 +02:00
|
|
|
describe('UserPreferencedTokenInput 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
|
|
|
},
|
|
|
|
},
|
2021-02-04 19:15:23 +01:00
|
|
|
};
|
2018-10-17 01:03:29 +02:00
|
|
|
|
2021-04-15 20:01:46 +02:00
|
|
|
expect(mapStateToProps(mockState)).toStrictEqual({
|
2018-10-26 10:26:43 +02:00
|
|
|
useNativeCurrencyAsPrimaryCurrency: true,
|
2021-02-04 19:15:23 +01:00
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|