You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The testing library follows a different set of guiding principles. I think you have your unit testing hat on but you need to think more from a users perspective. I'd say in order to test that component you'd want to know what side effect pressing the button creates.
For example checkout this test in which clicking the button changes the text of the button, which is what the user would see. So we validate that the button text changed, not that the buttons handler got called (which you are indirectly testing anyway).
The documentation is very simple and with few examples.
All of the click examples I saw, none clicks to see if the function is being called.
How to do this?
I try this, but isn't work:
The text was updated successfully, but these errors were encountered: