Add test for iterables, too
Andrew Clark committed
Jan 17, 2017 at 09:57 UTC
1ac6be267784b7c42f4d478460ba374bb4626ae8
2 files changed
+4
-2
scripts/fiber/tests-passing.txt
+1
-1
@@ -554,7 +554,7 @@ src/renderers/dom/fiber/__tests__/ReactDOMFiber-test.js
554
* should not crash encountering low-priority tree
555
* throws if non-element passed to top-level render
556
* throws if something other than false, null, or an element is returned from render
557
-* still accepts arrays as host children
557
+* still accepts arrays and iterables as host children
558
559
src/renderers/dom/shared/__tests__/CSSProperty-test.js
560
* should generate browser prefixes for its `isUnitlessNumber`
src/renderers/dom/fiber/__tests__/ReactDOMFiber-test.js
+3
-1
@@ -1120,12 +1120,14 @@ describe('ReactDOMFiber', () => {
1120
expect(() => ReactDOM.render(<Render>[<div />]</Render>, container)).toThrow(/You may have returned undefined/);
1121
});
1122
1123
- it('still accepts arrays as host children', () => {
1123
+ it('still accepts arrays and iterables as host children', () => {
1124
function Render(props) {
1125
return <div>{props.children}</div>;
1126
}
1127
ReactDOM.render(<Render>{['foo', 'bar']}</Render>, container);
1128
expect(container.textContent).toEqual('foobar');
1129
+ ReactDOM.render(<Render>{new Set(['foo', 'bar'])}</Render>, container);
1130
+ expect(container.textContent).toEqual('foobar');
1131
});
1132
});
1133
}