You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Produces a type error in the buildQueries function
type error
Argument of type'AllByAttribute' is not assignable to parameter of type'GetAllBy<[container: HTMLElement, id: Matcher, options?: MatcherOptions | undefined]>'.
Types of parameters 'attribute' and 'container' are incompatible.
Type 'HTMLElement' is not assignable to type'string'.
buildQueries(queryAllByDataCy, getMultipleError, getMissingError)
Expected behavior
When converting the provided example to typescript the setup example should be in a format that conforms to the libraries type AllByAttribute.
This can be done by using partial application the container argument on queryHelpers.queryAllByAttribute and then updating the type of AllByAttribute to omit the partial argument
e.g.
Describe the bug
https://testing-library.com/docs/react-testing-library/setup#add-custom-queries
Existing setup for custom queries documentation does not work with typescript
To Reproduce
converting the following to typescript
Produces a type error in the buildQueries function
type error
Expected behavior
When converting the provided example to typescript the setup example should be in a format that conforms to the libraries type AllByAttribute.
This can be done by using partial application the container argument on
queryHelpers.queryAllByAttribute
and then updating the type of AllByAttribute to omit the partial argumente.g.
js only:
ts only:
Screenshots
If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered: