in js file
import { bindActionCreators } from "redux";
const mapDispatchToProps = dispatch => {
const MyActions = bindActionCreators(MyActions, dispatch);
return {
actions: {
method1: () => {
MyActions.myActionMethod();
},
}
Now I want to test if calling of method1 dispatches MyActions.myActionMethod
my .test.js code
it("Should call myAction", () => {
jest
.spyOn(MyActions, "myActionMethod")
.mockImplementation(() => {
console.log("calling mock imple");
});
enzymeWrapper.props().actions.method1();
});
can anyone suggest to me how to mock bindActionCreators ?