-
Notifications
You must be signed in to change notification settings - Fork 50.8k
Description
Do you want to request a feature or report a bug?
Feature/documentation
What is the current behavior?
There is almost none documentation about how to actually use .renderIntoDocument() method. I can't find find answers on those questions on Jest's website or enzyme's (I know that it's not Facebook) either.
- If I render a component into a DOM in a test, how will it be destroyed?
- Should I clean up by myself?
- What tools to use for this?
- Just
.unmountComponentAtNode()? - Where I will get the container to pass in?
- What about additional component trees like in Popovers?
- What are the best ways to test that there aren't any parts left after my component were unmounted?
If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem via https://jsfiddle.net or similar (template: https://jsfiddle.net/84v837e9/).
What is the expected behavior?
It will be nice to see such information before people will met memory leaks in their tests, and also help to establish good practices for writing tests.
Which versions of React, and which browser / OS are affected by this issue? Did this work in previous versions of React?