-
Notifications
You must be signed in to change notification settings - Fork 471
findBy* & findAllBy* have wrong argument types for TS #534
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
Can you add your definition of queryAllByAutomationId, so I can replicate this or create a sandbox where this behaviour is visible? |
@Lagily I updated the original issue's text with definitions of that function. |
We recently moved the types into this package and I think this was fixed. Please open a new issue if that's not the case. Thank you! |
@kentcdodds this wasn't. |
@denysdovhan Do you think you could make a pull request that fixes this? I see the problem, but I am unable to find a way to do this in TypeScript currently, as the passed params need to be put in between the HtmlElement and waitFor params that are always returned And yeah this is sadly not fixed, issue could be reopened |
@Lagily I'm not familiar with TS typings so well :( |
🎉 This issue has been resolved in version 7.5.6 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
DOM Testing Library
version: 7.2.0node
version: 12.13.0yarn
version: 1.22Relevant code or config:
What you did:
I generated custom
findBy
andfindAllBy
queries bybuildQueries
.What happened:
Generated queries have lost TypeScript types for 4th argument
waitForOptions
.Problem description:
I've noticed all
findBy*
/findAllBy*
methods have 4th param, for example:However,
buildQueries
returnsFindBy
andFindAllBy
queries without that param:Suggested solution:
Add 4th param type to the
QueryMethod
type or make specialFindQueryMethod
type with that param.The text was updated successfully, but these errors were encountered: