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

Wrapper is unmounted when shouldIgnoreViolations is called #48

Closed
robertknight opened this issue Oct 22, 2024 · 0 comments · Fixed by #49
Closed

Wrapper is unmounted when shouldIgnoreViolations is called #48

robertknight opened this issue Oct 22, 2024 · 0 comments · Fixed by #49

Comments

@robertknight
Copy link
Member

When debugging a test failure with an axe-core update in hypothesis/client#6620 I ran into a confusing issue where elements were missing from the Enzyme wrapper in the shouldIgnoreViolations callback to checkAccessibility. The reason is that the component gets unmounted before violations are filtered with shouldIgnoreViolations. See

wrapper.unmount();
.

Querying the Enzyme tree inside this callback is probably going to be a common need, so we should probably defer unmounting until after it has been used.

robertknight added a commit that referenced this issue Oct 22, 2024
Change a potentially confusing behavior where components were unmounted before
calling the `shouldIgnoreViolation` callback. Querying the rendered tree within
the callback, eg. to get the ID of an element to check if a violation relates to
it, could fail due to this.

Fixes #48.
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

Successfully merging a pull request may close this issue.

1 participant