-
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
fix: update getByTestId types #74
fix: update getByTestId types #74
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure 👍
I'm actually wondering if getByAltText and other queries should also switch to exact match by default - since regex and functions are supported case-insensitive-partial-match seems a bit gratuitous. Especially since |
🎉 This PR is included in version 2.5.2 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
That's fair. We should make that change in a major version bump though. I was thinking that if you wanted to do a more specific match you could use a regex with The thing is, if we consider it from a user's standpoint, they don't care whether the letters are capitals or wither the button says: "Submit form" or "Submit". It's all the same to them. I think that's what motivated the partial match for strings in my mind. |
True, but there are other standpoints to consider, i.e., the product spec says button text should be capitalized or a styleguide says all copy should end in
I think this makes sense because the most basic "includes text" regex is just I could see implementing this by exposing the final options argument to the https://github.com/kentcdodds/dom-testing-library/blob/master/src/queries.js#L73 |
…textNode changes (testing-library#74) * ensure waitForElement responds to attribute and textNode changes by default * Add rbrtsmith as a contributor * Update README with change mutationObserverOptions * Add missing new line in test
See testing-library/dom-testing-library#29