Closed
Description
@testing-library/react
version: 11.2.2
Relevant code or config:
const { container } = render( // container is `Element` here
<MyComponent/>,
)
expect(getByText(container, someText)).toBeInTheDocument() // Error: Argument of type 'Element' is not assignable to parameter of type 'HTMLElement'.
expect(getByTestId(container, 'test-id')).toBeInTheDocument() // Error: Argument of type 'Element' is not assignable to parameter of type 'HTMLElement'.
Problem description:
After testing-library/react-testing-library#833 I get type errors because container
no more HTMLElement
.
container as HTMLElement
doesn't seem like a good solution.
Metadata
Metadata
Assignees
Labels
No labels