We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
container
Current container API has following issues:
Some users have been trying to use it in their component tests in a following way:
test('renders correctly', () => { const { container } = render(<Test />); expect(container).toBeEmptyElement() // this should fail, but passes });
UNSAFE_root
root
render
screen.root
test('renders correctly', () => { render(<Test />); expect(screen.root).toBeEmptyElement() });
This should be released as part of v12.
The text was updated successfully, but these errors were encountered:
@thymikee @AugustinLF @pierrezimmermannbam @MattAgn looks good, or do you see something worth changing?
Sorry, something went wrong.
No this seems good to me!
Seems good to me too
Successfully merging a pull request may close this issue.
Summary
Current
container
API has following issues:Some users have been trying to use it in their component tests in a following way:
Suggested solution
container
toUNSAFE_root
to allow easy migration for users that might have valid uses forcontainer
API.container
log deprecation message pointing toUNSAFE_root
root
return fromrender
(+screen.root
) that would expose root host component. This will allow to simplify writing component test, eg.:Related Issues
This should be released as part of v12.
The text was updated successfully, but these errors were encountered: