-
Notifications
You must be signed in to change notification settings - Fork 472
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
queryByRole types aren't aligned to implementation #142
Comments
Also, as you can see here, |
I think that's my bad I did not update the typescript definitions when I added role since I'm not as versed as TS. I will look at adding that today. |
I take that back someone did add the typings from what I can tell. As seen here. I will need help from someone who knows more about TS to help troubleshoot. Perhaps @jenovs might be of assistance here. |
I'm still learning the ropes of TS and my PR just removed redundant letter |
Well, I can create a PR this weekend to align these typing issues if you want. Just let me know your plans. Thank you for the attentions guys! |
You are welcome to. Like I said I would help out more if I knew TS more. I just used the annotations that everyone else was using. 😄 |
closes #142 <!-- Thanks for your interest in the project. Bugs filed and PRs submitted are appreciated! Please make sure that you are familiar with and follow the Code of Conduct for this project (found in the CODE_OF_CONDUCT.md file). Also, please make sure you're familiar with and follow the instructions in the contributing guidelines (found in the CONTRIBUTING.md file). If you're new to contributing to open source projects, you might find this free video course helpful: http://kcd.im/pull-request Please fill out the information below to expedite the review and (hopefully) merge of your pull request! --> <!-- What changes are being made? (What feature/bug is being fixed here?) --> **What**: <!-- Why are these changes necessary? --> **Why**: <!-- How were these changes implemented? --> **How**: <!-- Have you done all of these things? --> **Checklist**: <!-- add "N/A" to the end of each line that's irrelevant to your changes --> <!-- to check an item, place an "x" in the box like so: "- [x] Documentation" --> - [ ] Documentation - [ ] Tests - [ ] Ready to be merged <!-- In your opinion, is this ready to be merged as soon as it's reviewed? --> - [ ] Added myself to contributors table <!-- this is optional, see the contributing guidelines for instructions --> <!-- feel free to add additional comments -->
🎉 This issue has been resolved in version 3.12.1 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
dom-testing-library
version:^3.10.1
react
version:^16.6.0
node
version:9.2.0
npm
(oryarn
) version:yarn v1.10.1
Relevant code or config:
What you did:
I've ran some tests.
What happened:
Tests are passing, but TypeScript is complaining.
Reproduction:
Problem description:
Basically, tests are passing, but TypeScript complains that
queryByRole
expects from3-4
arguments and it's getting 2.According to your
typings
, that seems expected though:The first argument
QueryAttribute
expects isattribute: string;
, but that doesn't make sense because the attribute I want is already expressed byqueryByRole
(which isrole
).Same happens with
queryByAltText
. i.e.:Suggested solution:
My suggested solution is to better design these interfaces to properly fit to the signatures of these methods that already have an explicit
attribute
. I can create a PR for that, just want to make sure if I'm not daydreaming or something.Thanks!
The text was updated successfully, but these errors were encountered: