Skip to content

Commit

Permalink
[React] Don't attach to document in ReactTestUtils.renderIntoDocument.
Browse files Browse the repository at this point in the history
  • Loading branch information
Ben Newman authored and zpao committed Feb 3, 2014
1 parent 85270ae commit ce95c3d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/test/ReactTestUtils.js
Expand Up @@ -43,7 +43,11 @@ function Event(suffix) {}
var ReactTestUtils = {
renderIntoDocument: function(instance) {
var div = document.createElement('div');
document.documentElement.appendChild(div);
// None of our tests actually require attaching the container to the
// DOM, and doing so creates a mess that we rely on test isolation to
// clean up, so we're going to stop honoring the name of this method
// (and probably rename it eventually) if no problems arise.
// document.documentElement.appendChild(div);
return React.renderComponent(instance, div);
},

Expand Down

1 comment on commit ce95c3d

@amccloud
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Testing the onLoad event handler of an iframe requires attaching the container to the DOM.

Please sign in to comment.