I have a component which is connected to store. And I have to test a function inside the react component. How can I reach to that function?
Eg:
var newReactComponent = React.createClass({
functionToBeTested: function(){
this.props.actions.fetchAll();
}
});
var mapStateToProps = function (state) {
return {
cars: state.carReducer.cars
}
};
var mapDispatchToProps = function (dispatch) {
return {
actions: bindActionCreators(_.assign({}, carActions, apiActions), dispatch)
}
};
module.exports = connect(mapStateToProps, mapDispatchToProps)(newReactComponent);
`