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.
39 lines
997 B
39 lines
997 B
import sinon from 'sinon';
|
|
|
|
import { updateSendAmount } from '../../../../ducks/send';
|
|
|
|
let mapDispatchToProps;
|
|
|
|
jest.mock('react-redux', () => ({
|
|
connect: (_, md) => {
|
|
mapDispatchToProps = md;
|
|
return () => ({});
|
|
},
|
|
}));
|
|
|
|
jest.mock('../../../../ducks/send', () => ({
|
|
updateSendAmount: jest.fn(),
|
|
}));
|
|
|
|
require('./send-amount-row.container');
|
|
|
|
describe('send-amount-row container', () => {
|
|
describe('mapDispatchToProps()', () => {
|
|
let dispatchSpy;
|
|
let mapDispatchToPropsObject;
|
|
|
|
beforeEach(() => {
|
|
dispatchSpy = sinon.spy();
|
|
mapDispatchToPropsObject = mapDispatchToProps(dispatchSpy);
|
|
});
|
|
|
|
describe('updateSendAmount()', () => {
|
|
it('should dispatch an action', () => {
|
|
mapDispatchToPropsObject.updateSendAmount('mockAmount');
|
|
expect(dispatchSpy.calledOnce).toStrictEqual(true);
|
|
expect(updateSendAmount).toHaveBeenCalled();
|
|
expect(updateSendAmount).toHaveBeenCalledWith('mockAmount');
|
|
});
|
|
});
|
|
});
|
|
});
|
|
|