File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ const Badge = React.createClass({
1010
1111 hasContent ( ) {
1212 return ValidComponentChildren . hasValidComponent ( this . props . children ) ||
13+ ( React . Children . count ( this . props . children ) > 1 ) ||
1314 ( typeof this . props . children === 'string' ) ||
1415 ( typeof this . props . children === 'number' ) ;
1516 } ,
Original file line number Diff line number Diff line change @@ -31,6 +31,16 @@ describe('Badge', function () {
3131 assert . ok ( instance . getDOMNode ( ) . className . match ( / \b b a d g e \b / ) ) ;
3232 } ) ;
3333
34+ it ( 'Should have a badge using a a mix of content' , function ( ) {
35+ let count = 42 ;
36+ let instance = ReactTestUtils . renderIntoDocument (
37+ < Badge >
38+ £{ count }
39+ </ Badge >
40+ ) ;
41+ assert . ok ( instance . getDOMNode ( ) . className . match ( / \b b a d g e \b / ) ) ;
42+ } ) ;
43+
3444 it ( 'Should have a badge class pulled right' , function ( ) {
3545 let instance = ReactTestUtils . renderIntoDocument (
3646 < Badge pullRight >
You can’t perform that action at this time.
0 commit comments