Hedera-Lang-Learn / hedera

MIT License
10 stars 2 forks source link

Make actions use async #476

Closed jaguillette closed 1 year ago

jaguillette commented 1 year ago

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.

arthurian commented 1 year ago

Note: Bill, Vesna, and I discussed this PR in Hedera dojo. Going to go ahead and merge.