Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Why to avoid .simulate? Rather use `props` to call fn directly? #1606
Well, this is not exactly an issue but a question.
Interestingly, most of the comments suggest that:
Yes, the suggested method works, but I just wanted to understand why that is the case? Is that something enzyme can't do well or enzyme actually uses
Thanks for your time on this.
My understanding is Jest/enzyme is using JS DOM, which is not real DOM, it has problem mocking browser event.
There is a brief Gotchas section at the end of the
Hello, @ljharb, I have a question for you, if you don't mind. I saw you were saying that it's better to invoke functions directly, without simulate, so what would be the proper way to test onChange event with an event parameter? Is it enough to check if it was called or there is more that has to be done? I would appreciate your advice, thanks.