This PR fixes a memory leak connected to TestUtils.renderIntoDocument which would cause karma to crash if more tests were to get added.
How do I validate this PR?
Tests still need to be passing. One could output to the console the result of React.unmountComponentAtNode used in the afterEach
What does this PR do not do?
It does not cover ShallowRenderer. Based on what is coming in the next version of React, we might want to rewrite the tests using the Shallow Renderer are these tests are very hard to read and maintain. If we decide to keep the Shallow Renderer, we might want to rename the output of both useDocumentRenderer and useShallowRenderer to be more explicit.
What does this PR do?
This PR fixes a memory leak connected to TestUtils.renderIntoDocument which would cause karma to crash if more tests were to get added.
How do I validate this PR?
Tests still need to be passing. One could output to the console the result of
React.unmountComponentAtNode
used in theafterEach
What does this PR do not do?
It does not cover ShallowRenderer. Based on what is coming in the next version of React, we might want to rewrite the tests using the Shallow Renderer are these tests are very hard to read and maintain. If we decide to keep the Shallow Renderer, we might want to rename the output of both useDocumentRenderer and useShallowRenderer to be more explicit.