-
Notifications
You must be signed in to change notification settings - Fork 25
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
Testing RuxInput in React with react-testing-library #1114
Comments
Possibly related to #115? |
Yup, looks like I screwed up the code in the docs, thanks for catching that. I'll change it ASAP. It should look like:
Are you getting any sort of error when you run the test, or is it just failing with no helpful output? In case it's helpful, I created a fresh repo to test this all out in. It's working, but the test command had to be updated to I apologize again for the incorrect documentation. Please let me know if the above helps, or if there is anything else I can do! |
Hey Micah, this still doesn't fix my issue. form
test
package.json
jest.config.js
babel.config.json
Sorry this is a lot, but using the jest with the UserEvent.type() should make a console.log fire for every character but it is never happening. When I replace the with a native tag it works as expected. Does the use of jest change this? |
Alright, I've mimicked that test as much as I could, and I'm seeing the console logs fire when I run the tests. I did have to change it a bit because I'm just missing some context, but this is what I've got:
I think the important part here is probably using the |
Hey Micah, This got it to work, thanks for the help. I thought I had tried the testing-library__dom but must not have done it correctly. Sorry about the code being a little bit off, I had changed it for a function and didn't change it back to how it was to match your test. |
No worries! I'm glad it's working out. RTL and shadow dom are not friends, so hopefully it goes smoother from here on out. If not, please feel free to reach out to us! You can open a new issue/discussion, or if you'd rather you can email me directly at [email protected]. |
I am trying to replicate this test and am having a few problems. For the RuxInput, the setInput is not a prop to RuxInput, I changed this to onRuxinput and that resolved the issue with syntax. When I run this test, the
userEvent.type(shadowInput, 'User input!')
does not seem to fire the onRuxinput which makes it hard to test functionality that would go this RuxInput. Any tips or advice would be appreciated.Originally posted by @jarod-oa in #1113 (comment)
The text was updated successfully, but these errors were encountered: