-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
problem with material-ui elements #234
Comments
Does it work in the browser with the material-ui button? Also, probably unrelated, but you should not set the input elements values with It would help if you provided a ready-to-be-used reproduction repo, or better yet, a code sandbox. |
added sandbox https://codesandbox.io/s/lx5nl1839z |
Take a look at the button component implementation. |
Hmm... If that's the case then this is a bug because it should bubble up from the span to the button. Anyone care to look into why that's not happening? |
The event is bubbling, if you add an onClick handler to the Button then that fires. The issue seems to be that a bubbled event does not then trigger form submission. |
Oh, that's interesting. I wonder what happens in a real browser... Hmmm... |
I'm unable to reproduce this: https://codesandbox.io/s/mjm27nyp28 |
I think codesandbox is somehow running the tests in the browser and not in jsdom. I had a similar issue with jsdom not firing the |
That's exactly what's happening. Incidentally this is a great way to know whether what you're experiencing is a JSDOM issue or not 😉 |
I'm going to go ahead and try to make a smaller example that shows this problem using just JSDOM. Then I'll file that as an issue to JSDOM. |
Alright! Anyone wanna dig in jsdom to figure out what's going on? jsdom/jsdom#2449 |
A fix has been merged in jsdom. Hopefully it's released soon. Also hopefully Jest's version range of jsdom accepts the fix 🤞 There's nothing more we can do here, so I'll close this. |
I am still having the issue using MUI (material ui), I am expecting when clicking the 'login' button it will show the text of error helper. somehow the text does not show when I use Any suggestion? for context
|
react-testing-library
version: 5.3.1react
version: 16.7.0-alpha.2node
version: 10npm
(oryarn
) version: 6.1.0Relevant code or config:
// login-form
What you did:
Writing my first test with material-ui for a login form.
https://codesandbox.io/s/lx5nl1839z
What happened:
Test would not pass when I try to click on the submit button. BUT It works as expected if I use a regular button instead of a material ui Button.
Reproduction:
Problem description:
Suggested solution:
The text was updated successfully, but these errors were encountered: