@@ -25,11 +25,41 @@ describe('linkClass', () => {
25
25
expect ( linkClass ( < div className = 'foo' > </ div > ) ) . to . deep . equal ( < div className = 'foo' > </ div > ) ;
26
26
} ) ;
27
27
28
- // Using array instead of object causes the following error:
29
- // Warning: Each child in an array or iterator should have a unique "key" prop.
30
- // Check the render method of _class. See https://fb.me/react-warning-keys for more information.
31
- xit ( 'does not affect element with multiple children' , ( ) => {
32
- expect ( linkClass ( < div > < p > </ p > < p > </ p > </ div > ) ) . to . deep . equal ( < div > < p > </ p > < p > </ p > </ div > ) ;
28
+ // Does not affect
29
+ it ( 'does not affect element with a single children when that children is contained in an array' , ( ) => {
30
+ let outcome ,
31
+ subject ;
32
+
33
+ subject = React . createElement ( 'div' , null , [
34
+ React . createElement ( 'p' )
35
+ ] ) ;
36
+ outcome = React . createElement ( 'div' , null , [
37
+ React . createElement ( 'p' )
38
+ ] ) ;
39
+
40
+ expect ( linkClass ( subject ) ) . to . deep . equal ( outcome ) ;
41
+ } ) ;
42
+
43
+ it ( 'does not affect element with multiple children' , ( ) => {
44
+ // Using array instead of object causes the following error:
45
+ // Warning: Each child in an array or iterator should have a unique "key" prop.
46
+ // Check the render method of _class. See https://fb.me/react-warning-keys for more information.
47
+ // @see https://github.com/facebook/react/issues/4723#issuecomment-135555277
48
+ // expect(linkClass(<div><p></p><p></p></div>)).to.deep.equal(<div><p></p><p></p></div>);
49
+
50
+ let outcome ,
51
+ subject ;
52
+
53
+ subject = React . createElement ( 'div' , null , [
54
+ React . createElement ( 'p' ) ,
55
+ React . createElement ( 'p' )
56
+ ] ) ;
57
+ outcome = React . createElement ( 'div' , null , [
58
+ React . createElement ( 'p' ) ,
59
+ React . createElement ( 'p' )
60
+ ] ) ;
61
+
62
+ expect ( linkClass ( subject ) ) . to . deep . equal ( outcome ) ;
33
63
} ) ;
34
64
} ) ;
35
65
0 commit comments