I have trouble testing the react function that is calling the action. below is the function –
const sendForm = () => {
Promise.resolve(dispatch(updateBase(a,b,c)))
.then(res => {
if(!res.payload.errMessage){
dispatch(fetchLogic(d,e,f))
}
})
}
Here is the react action that it is calling –
const updateBase = (a,b,c) => (dispatch) => {
return apiURL.post(...)
.then(res => dispatch(yetAnotherAction()))
.catch(err => dispatch(errorAction()))
}
I want to test the success scenario for sendForm Function, how can we do so?