1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-28 23:06:37 +01:00
metamask-extension/ui/pages/send/send-content/send-amount-row/send-amount-row.container.test.js
2021-06-23 16:35:25 -05:00

40 lines
1000 B
JavaScript

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.js');
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');
});
});
});
});