Open
Description
Relevant code or config:
expect(svgElement).toBeVisible();
What happened:
received value must be an HTMLElement or an SVGElement.
Problem description:
Several Testing Libraries are having their TypeScript types updated to take Element
rather than HTMLElement
as arguments so other element types like SVGElement
are allowed. However, Jest DOM performs runtime checks against HTMLElement
and SVGElement
, so that any other element type would fail.
Suggested solution:
We should update our typechecking to check instanceof Element
for consistency with #306 and testing-library/react-testing-library#833.
Metadata
Metadata
Assignees
Labels
No labels