dimanche 20 octobre 2019

Jest - get current props while mocking a function

I am trying to simulate updating the props after a function gets called in my component on a button click event. loadMoreUsers returns an array of n+20 users and also updates the totalCount in the actual component. How do I check in my jest test that the users array and the totalCount are updated as well when loadMoreUsers gets called? As of now, the only thing I am testing is that the loadMoreUsers function gets called when the button is clicked.

Aucun commentaire:

Enregistrer un commentaire