-
Notifications
You must be signed in to change notification settings - Fork 470
Update docs to remove toBeInTheDOM #75
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
Comments
I'll take this one too, so we can merge and release this prior or alongside to the corresponding change in testing-library/react-testing-library#140. |
Indeed
Which one would be preferable? As for the README, in case option 1 above is not acceptable, would it be ok if in the README examples we assume the DOM being tested in each example (generally put in comments) is mounted in the document, and we replace all uses of |
I prefer: |
I'm in doubt about this use of |
Feel free to rewrite that test. I never really liked it much. |
Now I have another question:
expect(container).toContainElement(queryByTestId(container, 'ok-button')) This happens quite a bit in the README examples. Nothing wrong about that per-se, just wanted to make sure is ok before taking the effort to change it. |
Ah, that's fair, and kinda annoying. Maybe we should do |
Honestly, for me the real assertion is the |
Ok, I'll see what I can do. |
Now that the library is throwing warning about using |
Would you like to make that update? :) |
I think I did this at some point. In any case, they're gone! |
Regarding the deprecation of
toBeInTheDOM
we should either find better assertions or usetoBeInTheDocument
: testing-library/jest-dom#40Anyone wanna try that?
For dom-testing-library, most of the examples aren't actually attached to
document.body
sotoBeInTheDocument
wont work. We'll have to think of something better on a case-by-case basis I think.The text was updated successfully, but these errors were encountered: