Skip to content

Commit

Permalink
[fixed] Define toggleNavKey in the propTypes
Browse files Browse the repository at this point in the history
  • Loading branch information
teloo committed Feb 27, 2015
1 parent 1a4ae1d commit 25b4143
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Navbar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ var Navbar = React.createClass({
componentClass: React.PropTypes.node.isRequired,
brand: React.PropTypes.node,
toggleButton: React.PropTypes.node,
toggleNavKey: React.PropTypes.oneOfType([
React.PropTypes.string,
React.PropTypes.number
]),
onToggle: React.PropTypes.func,
navExpanded: React.PropTypes.bool,
defaultNavExpanded: React.PropTypes.bool
Expand Down
13 changes: 13 additions & 0 deletions test/NavbarSpec.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -150,4 +150,17 @@ describe('Nav', function () {

assert.ok(header);
});

it('Should add header when toggleNavKey is string', function () {
var instance = ReactTestUtils.renderIntoDocument(
<Navbar toggleNavKey={'string'}>
<Nav eventKey={'string'}>
</Nav>
</Navbar>
);

var header = ReactTestUtils.findRenderedDOMComponentWithClass(instance, 'navbar-header');

assert.ok(header);
});
});

0 comments on commit 25b4143

Please sign in to comment.