@@ -25,6 +25,19 @@ describe('ListGroup', function () {
2525 assert . ok ( ReactTestUtils . findRenderedDOMComponentWithClass ( items [ 0 ] , 'list-group-item' ) ) ;
2626 } ) ;
2727
28+ it ( 'Should support a single "ListGroupItem" child contained in an array' , function ( ) {
29+ let child = [ < ListGroupItem key = { 42 } > Only Child in array</ ListGroupItem > ] ;
30+ let instance = ReactTestUtils . renderIntoDocument (
31+ < ListGroup >
32+ { child }
33+ </ ListGroup >
34+ ) ;
35+
36+ let items = ReactTestUtils . scryRenderedComponentsWithType ( instance , ListGroupItem ) ;
37+
38+ assert . ok ( ReactTestUtils . findRenderedDOMComponentWithClass ( items [ 0 ] , 'list-group-item' ) ) ;
39+ } ) ;
40+
2841 it ( 'Should output a "ul" when single "ListGroupItem" child is a list item' , function ( ) {
2942 let instance = ReactTestUtils . renderIntoDocument (
3043 < ListGroup >
@@ -61,6 +74,26 @@ describe('ListGroup', function () {
6174 assert . ok ( ReactTestUtils . findRenderedDOMComponentWithClass ( items [ 1 ] , 'list-group-item' ) ) ;
6275 } ) ;
6376
77+ it ( 'Should support multiple "ListGroupItem" children including a subset contained in an array' , function ( ) {
78+ let itemArray = [
79+ < ListGroupItem key = { 0 } > 2nd Child nested</ ListGroupItem > ,
80+ < ListGroupItem key = { 1 } > 3rd Child nested</ ListGroupItem >
81+ ] ;
82+
83+ let instance = ReactTestUtils . renderIntoDocument (
84+ < ListGroup >
85+ < ListGroupItem > 1st Child</ ListGroupItem >
86+ { itemArray }
87+ < ListGroupItem > 4th Child</ ListGroupItem >
88+ </ ListGroup >
89+ ) ;
90+
91+ let items = ReactTestUtils . scryRenderedComponentsWithType ( instance , ListGroupItem ) ;
92+
93+ assert . ok ( ReactTestUtils . findRenderedDOMComponentWithClass ( items [ 0 ] , 'list-group-item' ) ) ;
94+ assert . ok ( ReactTestUtils . findRenderedDOMComponentWithClass ( items [ 1 ] , 'list-group-item' ) ) ;
95+ } ) ;
96+
6497 it ( 'Should output a "ul" when children are list items' , function ( ) {
6598 let instance = ReactTestUtils . renderIntoDocument (
6699 < ListGroup >
0 commit comments