diff --git a/src/addons/__tests__/ReactFragment-test.js b/src/addons/__tests__/ReactFragment-test.js
index 6b789e016a..d53e6020de 100644
--- a/src/addons/__tests__/ReactFragment-test.js
+++ b/src/addons/__tests__/ReactFragment-test.js
@@ -49,13 +49,13 @@ describe('ReactFragment', function() {
z:
};
var element =
. See ' +
- 'https://fb.me/react-warning-keys for more information.'
- );
- });
-
- it('warns for keys when reusing children', function() {
- spyOn(console, 'error');
-
- var f =
;
- var g =
;
-
- var children = [f, g];
-
- ReactTestUtils.renderIntoDocument(
-
-
- {g}
-
-
- {f}
-
-
- {children}
-
-
- );
-
- expect(console.error.argsForCall.length).toBe(1);
- expect(console.error.argsForCall[0][0]).toBe(
- 'Warning: Each child in an array or iterator should have a unique ' +
- '"key" prop. Check the React.render call using
. See ' +
- 'https://fb.me/react-warning-keys for more information.'
- );
- });
-
it('does not warn for keys when passing children down', function() {
spyOn(console, 'error');
@@ -525,4 +475,21 @@ describe('ReactElementValidator', function() {
expect(console.error.argsForCall.length).toBe(1);
});
+ it('does not warn when using DOM node as children', function() {
+ spyOn(console, 'error');
+ var DOMContainer = React.createClass({
+ render: function() {
+ return
;
+ },
+ componentDidMount: function() {
+ React.findDOMNode(this).appendChild(this.props.children);
+ }
+ });
+
+ var node = document.createElement('div');
+ // This shouldn't cause a stack overflow or any other problems (#3883)
+ ReactTestUtils.renderIntoDocument(
{node});
+ expect(console.error.argsForCall.length).toBe(0);
+ });
+
});