Skip to content

Commit 63c5ed2

Browse files
committed
Test for a single child and an array with one item
1 parent 3a39061 commit 63c5ed2

2 files changed

Lines changed: 2 additions & 7 deletions

File tree

src/isomorphic/children/ReactChildren.js

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,6 @@ var SUBSEPARATOR = ':';
3232
*
3333
*/
3434

35-
/**
36-
* TODO: Test that a single child and an array with one item have the same key
37-
* pattern.
38-
*/
39-
4035
var didWarnAboutMaps = false;
4136

4237
/**

src/isomorphic/children/__tests__/ReactChildren-test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ describe('ReactChildren', () => {
5151
return kid;
5252
});
5353

54-
var simpleKid = <span />;
54+
var simpleKid = <span key="simple" />;
5555
var instance = <div>{simpleKid}</div>;
5656
React.Children.forEach(instance.props.children, callback, context);
5757
expect(callback).toHaveBeenCalledWith(simpleKid, 0);
@@ -62,7 +62,7 @@ describe('ReactChildren', () => {
6262
context,
6363
);
6464
expect(callback).toHaveBeenCalledWith(simpleKid, 0);
65-
expect(mappedChildren[0]).toEqual(<span key=".0" />);
65+
expect(mappedChildren[0]).toEqual(<span key=".$simple" />);
6666
});
6767

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

0 commit comments

Comments
 (0)