Skip to content
Closed
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
Test for a single child and an array with one item
  • Loading branch information
koba04 committed Jun 29, 2017
commit 1ead8825f68bd7404e7426affc2942f7fadb6d1a
5 changes: 0 additions & 5 deletions src/isomorphic/children/ReactChildren.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,6 @@ var SUBSEPARATOR = ':';
*
*/

/**
* TODO: Test that a single child and an array with one item have the same key
* pattern.
*/

var didWarnAboutMaps = false;

/**
Expand Down
4 changes: 2 additions & 2 deletions src/isomorphic/children/__tests__/ReactChildren-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ describe('ReactChildren', () => {
return kid;
});

var simpleKid = <span />;
var simpleKid = <span key="simple" />;
var instance = <div>{simpleKid}</div>;
React.Children.forEach(instance.props.children, callback, context);
expect(callback).toHaveBeenCalledWith(simpleKid, 0);
Expand All @@ -71,7 +71,7 @@ describe('ReactChildren', () => {
context,
);
expect(callback).toHaveBeenCalledWith(simpleKid, 0);
expect(mappedChildren[0]).toEqual(<span key=".0" />);
expect(mappedChildren[0]).toEqual(<span key=".$simple" />);
});

it('should treat single child in array as expected', () => {
Expand Down