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
it('example',()=>{const{ container }=render(<span>foo</span>);// container type is ElementgetByText(containerasHTMLElement,'foo');// can't use container here without casting to HTMLElement});
Hi @pawbor, thanks for taking the time to open this :)
This one looks like a duplicate of testing-library/dom-testing-library#838.
@nickmccurdy is already working on a fix for this I believe.
@testing-library/react
version: 11.2.2Relevant code or config:
What you did:
I tried to use container in custom query.
What happened:
Types do not match without manual casting.
Reproduction:
https://codesandbox.io/s/react-testing-library-demo-forked-bt601?file=/src/__tests__/hello.tsx
Suggested solution:
Loosening type requirements for element provided to Queries
The text was updated successfully, but these errors were encountered: