Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: ReferenceError: SVGElement is not defined when isVisible() is called on an SVG element. #2024

Closed
3rdvision opened this issue Nov 4, 2022 · 1 comment

Comments

@3rdvision
Copy link
Contributor

3rdvision commented Nov 4, 2022

Subject of the issue

A test will fails and throw ReferenceError: SVGElement is not defined when calling isVisible() on an SVG element.

Expected behaviour

Can correctly verify if an SVG Element is visible.

Actual behaviour

Throws an error when verifying if an SVG Element is visible.

Possible Solution

The issue was introduced here with the purpose to make isVisible more comprehensive. This was ported from jest-dom as it is declared on the function comment but looking at js-dom repository they don't have instanceof SVGElement but, instead instanceof window.SVGElement which makes sense. Also, I have tried this fix and it worked so I will open PR with this suggested change and let you guys decide.

@lmiller1990
Copy link
Member

Replied to your PR, thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants