-
Notifications
You must be signed in to change notification settings - Fork 785
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
bug: Error when using testing-library/dom getByRole #5252
Comments
Thanks @angelo-v! I was able to confirm this is a bug with how Stencil represents the relationship between Nodes and their owning |
…ull (#5336) * fix(mock-doc): overwrite parentElement in MockHTMLElement to return null fixes #5252 STENCIL-1104 * add test * only return null for html elements * fix unit tests * tweak * another tweak * revert tests and correct implementation * update tests * prettier * minor comment tweak * fix assertion
A fix for this was included in today's v4.12.2 release! |
getByRole now seems to work, thank you! But I am getting follow up errors with
Should I open a seperate issue for this? |
Yes please! Can you also provide a minimal reproducible example again? Thank you! |
Prerequisites
Stencil Version
4.9.1
Current Behavior
When using
testing-library/dom
with stencil an error occurs when usinggetByRole
:Expected Behavior
getByRole
should find elements with the given role, or say it could not be found, but it should not lead to the above error.System Info
Steps to Reproduce
Component under test:
test:
Code Reproduction URL
https://github.com/angelo-v/stencil-testing-library-dom-error/blob/main/src/components/my-component/my-component.spec.ts
Additional Information
It works when setting the
hidden
option:The text was updated successfully, but these errors were encountered: