2021-04-15 20:01:46 +02:00
|
|
|
/* eslint-disable import/unambiguous */
|
2021-02-04 19:15:23 +01:00
|
|
|
let mapStateToProps;
|
2018-05-05 17:11:53 +02:00
|
|
|
|
2021-04-15 20:01:46 +02:00
|
|
|
jest.mock('react-redux', () => ({
|
|
|
|
connect: (ms) => {
|
|
|
|
mapStateToProps = ms;
|
|
|
|
return () => ({});
|
2018-05-05 17:11:53 +02:00
|
|
|
},
|
2021-04-15 20:01:46 +02:00
|
|
|
}));
|
|
|
|
|
2021-06-23 23:35:25 +02:00
|
|
|
jest.mock('../../../../../ducks/send', () => ({
|
2021-04-15 20:01:46 +02:00
|
|
|
getSendErrors: (s) => `mockErrors:${s}`,
|
|
|
|
}));
|
|
|
|
|
2022-07-27 21:32:17 +02:00
|
|
|
require('./send-row-error-message.container');
|
2018-05-05 17:11:53 +02:00
|
|
|
|
2021-04-15 20:01:46 +02:00
|
|
|
describe('send-row-error-message container', () => {
|
|
|
|
describe('mapStateToProps()', () => {
|
|
|
|
it('should map the correct properties to props', () => {
|
|
|
|
expect(
|
2020-11-03 00:41:28 +01:00
|
|
|
mapStateToProps('mockState', { errorType: 'someType' }),
|
2021-04-15 20:01:46 +02:00
|
|
|
).toStrictEqual({
|
|
|
|
errors: 'mockErrors:mockState',
|
|
|
|
errorType: 'someType',
|
|
|
|
});
|
2021-02-04 19:15:23 +01:00
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|