diff --git a/src/Navbar.jsx b/src/Navbar.jsx index a6539dedcf..0bb2f749d3 100644 --- a/src/Navbar.jsx +++ b/src/Navbar.jsx @@ -75,7 +75,7 @@ var Navbar = React.createClass({ return (
- {(this.props.brand || this.props.toggleButton || this.props.toggleNavKey) ? this.renderHeader() : null} + {(this.props.brand || this.props.toggleButton || this.props.toggleNavKey != null) ? this.renderHeader() : null} {ValidComponentChildren.map(this.props.children, this.renderChild)}
diff --git a/test/NavbarSpec.jsx b/test/NavbarSpec.jsx index 3fd34df4f7..b21ce34fe4 100644 --- a/test/NavbarSpec.jsx +++ b/test/NavbarSpec.jsx @@ -124,4 +124,30 @@ describe('Nav', function () { assert.equal(navNode.nodeName, 'UL'); assert.equal(navNode.parentNode.nodeName, 'DIV'); }); + + it('Should add header when toggleNavKey is 0', function () { + var instance = ReactTestUtils.renderIntoDocument( + + + + ); + + var header = ReactTestUtils.findRenderedDOMComponentWithClass(instance, 'navbar-header'); + + assert.ok(header); + }); + + it('Should add header when toggleNavKey is 1', function () { + var instance = ReactTestUtils.renderIntoDocument( + + + + ); + + var header = ReactTestUtils.findRenderedDOMComponentWithClass(instance, 'navbar-header'); + + assert.ok(header); + }); });