'How can i test the promise function at jest with react testing library?

function that i am trying to test

I have this function and i am trying to test it here:

enter image description here

I am trying to make the onClose function callable, but I get an error at this line => expect(onClose).toHaveBeenCalled();



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source