Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add test for iterables, too
  • Loading branch information
acdlite committed Jan 25, 2017
commit 1ac6be267784b7c42f4d478460ba374bb4626ae8
2 changes: 1 addition & 1 deletion scripts/fiber/tests-passing.txt
Original file line number Diff line number Diff line change
Expand Up @@ -554,7 +554,7 @@ src/renderers/dom/fiber/__tests__/ReactDOMFiber-test.js
* should not crash encountering low-priority tree
* throws if non-element passed to top-level render
* throws if something other than false, null, or an element is returned from render
* still accepts arrays as host children
* still accepts arrays and iterables as host children

src/renderers/dom/shared/__tests__/CSSProperty-test.js
* should generate browser prefixes for its `isUnitlessNumber`
Expand Down
4 changes: 3 additions & 1 deletion src/renderers/dom/fiber/__tests__/ReactDOMFiber-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -1120,12 +1120,14 @@ describe('ReactDOMFiber', () => {
expect(() => ReactDOM.render(<Render>[<div />]</Render>, container)).toThrow(/You may have returned undefined/);
});

it('still accepts arrays as host children', () => {
it('still accepts arrays and iterables as host children', () => {
function Render(props) {
return <div>{props.children}</div>;
}
ReactDOM.render(<Render>{['foo', 'bar']}</Render>, container);
expect(container.textContent).toEqual('foobar');
ReactDOM.render(<Render>{new Set(['foo', 'bar'])}</Render>, container);
expect(container.textContent).toEqual('foobar');
});
});
}
Expand Down