Make tests use ReactTestUtils.renderIntoDocument #1522
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
@zpao - this PR only has about a 1/3 of the tests converted where it seemed applicable. I wanted to start a discussion about a situation I ran into multiple times and wasn't sure what the desired way was to go about.
In some tests such as in ReactCSSTransitionGroup (and many others) there's a need to perform operations on the original container that the component got mounted on. So far I've used something like
@syranide points out and rightfully so that access to private instance's ID will probably not be available in ES6 classes which brings the question of whether or not we should make a helper method for this use case or come up with a better alternative.
I'm open to feedback on this and I'm referencing issue #1250