Description
react-testing-library
version: 7.0.0react
version: 16.8.4node
version: 8.12.0npm
(oryarn
) version: 6.9.0
Relevant code or config:
const { findByLabelText } = render(
<div />,
);
expect(await findByLabelText('anything', undefined, { timeout: 100 }))
.toHaveAttribute(
'aria-checked',
'mixed',
);
What you did:
Per the docs, the findBy queries accept the waitForElement
options as the last argument. The TypeScript configuration only reflects a possible 1-2 arguments instead of the expected 1-3.
I suspect this has to do with how RenderResult
(
react-testing-library/typings/index.d.ts
Lines 19 to 34 in 960451b
& {[P in keyof Q]: BoundFunction<Q[P]>
) with queries
via BoundFunction
(https://github.com/testing-library/dom-testing-library/blob/4fb00936cbf5b0d715f5b54d16576dc3bfe20460/typings/get-queries-for-element.d.ts#L4-L14).
I'd love to help; I'm hazy on how exactly the following works; which is where I believe the problem lies: