Fix EnterLeaveEventPlugin-test in IE10
Previously this was failing because iframeDocument.body wasn't properly initialized. Creating the document this way seems to work in all environments Test Plan: Ran the test in jest, phantomjs, IE10, Chrome, and Firefox.
Ben Alpert committed
Jun 7, 2014 at 18:45 UTC
e938116549fad743afa02308c5a43ff2c305e06f
1 file changed
+4
-3
src/browser/eventPlugins/__tests__/EnterLeaveEventPlugin-test.js
+4
-3
@@ -46,9 +46,10 @@ describe('EnterLeaveEventPlugin', function() {
46
47
var iframeDocument = iframe.contentDocument;
48
49
- if (!iframeDocument.innerHTML) {
50
- iframeDocument.innerHTML = '<html><head></head><body></body></html>';
51
- }
49
+ iframeDocument.write(
50
+ '<!DOCTYPE html><html><head></head><body></body></html>'
51
+ );
52
+ iframeDocument.close();
53
54
var component = React.renderComponent(<div />, iframeDocument.body);
55
var div = component.getDOMNode();