File tree 2 files changed +27
-1
lines changed
2 files changed +27
-1
lines changed Original file line number Diff line number Diff line change @@ -75,7 +75,7 @@ var Navbar = React.createClass({
75
75
return (
76
76
< ComponentClass { ...this . props } className = { joinClasses ( this . props . className , classSet ( classes ) ) } >
77
77
< div className = { this . props . fluid ? 'container-fluid' : 'container' } >
78
- { ( this . props . brand || this . props . toggleButton || this . props . toggleNavKey ) ? this . renderHeader ( ) : null }
78
+ { ( this . props . brand || this . props . toggleButton || this . props . toggleNavKey != null ) ? this . renderHeader ( ) : null }
79
79
{ ValidComponentChildren . map ( this . props . children , this . renderChild ) }
80
80
</ div >
81
81
</ ComponentClass >
Original file line number Diff line number Diff line change @@ -124,4 +124,30 @@ describe('Nav', function () {
124
124
assert . equal ( navNode . nodeName , 'UL' ) ;
125
125
assert . equal ( navNode . parentNode . nodeName , 'DIV' ) ;
126
126
} ) ;
127
+
128
+ it ( 'Should add header when toggleNavKey is 0' , function ( ) {
129
+ var instance = ReactTestUtils . renderIntoDocument (
130
+ < Navbar toggleNavKey = { 0 } >
131
+ < Nav eventKey = { 0 } >
132
+ </ Nav >
133
+ </ Navbar >
134
+ ) ;
135
+
136
+ var header = ReactTestUtils . findRenderedDOMComponentWithClass ( instance , 'navbar-header' ) ;
137
+
138
+ assert . ok ( header ) ;
139
+ } ) ;
140
+
141
+ it ( 'Should add header when toggleNavKey is 1' , function ( ) {
142
+ var instance = ReactTestUtils . renderIntoDocument (
143
+ < Navbar toggleNavKey = { 1 } >
144
+ < Nav eventKey = { 1 } >
145
+ </ Nav >
146
+ </ Navbar >
147
+ ) ;
148
+
149
+ var header = ReactTestUtils . findRenderedDOMComponentWithClass ( instance , 'navbar-header' ) ;
150
+
151
+ assert . ok ( header ) ;
152
+ } ) ;
127
153
} ) ;
You can’t perform that action at this time.
0 commit comments