This PR makes any action that makes an api call into an async function that awaits the response from the api, rather than relying on passing callbacks through to the api calls.
It also revamps the actions test suite to ensure that the API is being called with the expected parameters, mock out axios calls to the api to simulate a returned data object, and ensure that the mutation in the action is also called with the expected parameters. The first test in the suite has extra documentation to use as a reference implementation for adding additional action tests beyond the 5 that are currently implemented.
This PR makes any action that makes an api call into an
async
function thatawait
s the response from the api, rather than relying on passing callbacks through to the api calls.It also revamps the actions test suite to ensure that the API is being called with the expected parameters, mock out axios calls to the api to simulate a returned data object, and ensure that the mutation in the action is also called with the expected parameters. The first test in the suite has extra documentation to use as a reference implementation for adding additional action tests beyond the 5 that are currently implemented.