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

Element.contains does not check itself #776

Closed
CSchulz opened this issue Feb 22, 2023 · 1 comment · Fixed by #777
Closed

Element.contains does not check itself #776

CSchulz opened this issue Feb 22, 2023 · 1 comment · Fixed by #777
Labels
bug Something isn't working

Comments

@CSchulz
Copy link
Contributor

CSchulz commented Feb 22, 2023

Describe the bug
The Element contains method does not check if the given element is the element itself resulting in wrong results.

To Reproduce
Pseudo code:

const element = queryElement();
expect(element.contains(element)).toBeTruthy();

Expected behavior
contains should return true if the given element is the same element running the method on.

Device:

  • Version 8.7.1
@CSchulz CSchulz added the bug Something isn't working label Feb 22, 2023
capricorn86 added a commit that referenced this issue Feb 24, 2023
#776@patch: Add self equality check in node.contains method.
@capricorn86
Copy link
Owner

Thanks again for the contribution! 🌟

You can read more about the release here:
https://github.com/capricorn86/happy-dom/releases/tag/v8.7.4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants