1

I have a sandbox where I've recreated the issue I'm encountering in my codebase. I have a form with a required field, and a callback inside of the submit handler for the form. The actual component correctly does not fire the event handler if the form is not valid. However, the test fires the handler and thus the callback.

Sandbox Link

I'm using React 16.x, React Testing Library 10.x, Jest DOM 5.x. (all version numbers can be seen in the sandbox above).

Is my implementation actually incorrect, or is my test bad? or is there a bug in the artificial DOM used for the tests? I'm at a loss.

skyboyer
  • 22,209
  • 7
  • 57
  • 64
Marc Gray
  • 11
  • 1
  • Welcome to stackoverflow, it is better to display the relevant section of your code rather than link to the entire code, for more tips on asking read [this guide](https://stackoverflow.com/help/how-to-ask). – vlizana Jul 03 '20 at 04:49

0 Answers0