Skip to content

Commit

Permalink
fix(Navbar): remove default navigation role
Browse files Browse the repository at this point in the history
* fix(Navbar): Fixes #463 by ensuring that the default role is now empty
for nav elements.

* Updating tests.

* Removing trailing spaces.
  • Loading branch information
virgofx authored and eddywashere committed Jun 27, 2017
1 parent b598a40 commit f607b2c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
1 change: 0 additions & 1 deletion src/Navbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ const propTypes = {

const defaultProps = {
tag: 'nav',
role: 'navigation',
toggleable: false,
};

Expand Down
18 changes: 12 additions & 6 deletions src/__tests__/Navbar.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,31 +6,37 @@ describe('Navbar', () => {
it('should render .navbar markup', () => {
const wrapper = shallow(<Navbar />);

expect(wrapper.html()).toBe('<nav role="navigation" class="navbar"></nav>');
expect(wrapper.html()).toBe('<nav class="navbar"></nav>');
});

it('should render default .navbar-toggleable class', () => {
const wrapper = shallow(<Navbar toggleable />);

expect(wrapper.html()).toBe('<nav role="navigation" class="navbar navbar-toggleable"></nav>');
expect(wrapper.html()).toBe('<nav class="navbar navbar-toggleable"></nav>');
});

it('should render size based .navbar-toggleable-* classes', () => {
const wrapper = shallow(<Navbar toggleable="md" />);

expect(wrapper.html()).toBe('<nav role="navigation" class="navbar navbar-toggleable-md"></nav>');
expect(wrapper.html()).toBe('<nav class="navbar navbar-toggleable-md"></nav>');
});

it('should render custom tag', () => {
const wrapper = shallow(<Navbar tag="div" />);

expect(wrapper.html()).toBe('<div role="navigation" class="navbar"></div>');
expect(wrapper.html()).toBe('<div class="navbar"></div>');
});

it('should render role', () => {
const wrapper = shallow(<Navbar role="navigation" />);

expect(wrapper.html()).toBe('<nav role="navigation" class="navbar"></nav>');
});

it('sholid render children', () => {
it('should render children', () => {
const wrapper = shallow(<Navbar>Children</Navbar>);

expect(wrapper.html()).toBe('<nav role="navigation" class="navbar">Children</nav>');
expect(wrapper.html()).toBe('<nav class="navbar">Children</nav>');
});

it('should pass additional classNames', () => {
Expand Down

0 comments on commit f607b2c

Please sign in to comment.