Skip to content

Commit f607b2c

Browse files
virgofxeddywashere
authored andcommitted
fix(Navbar): remove default navigation role
* fix(Navbar): Fixes #463 by ensuring that the default role is now empty for nav elements. * Updating tests. * Removing trailing spaces.
1 parent b598a40 commit f607b2c

2 files changed

Lines changed: 12 additions & 7 deletions

File tree

src/Navbar.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ const propTypes = {
1919

2020
const defaultProps = {
2121
tag: 'nav',
22-
role: 'navigation',
2322
toggleable: false,
2423
};
2524

src/__tests__/Navbar.spec.js

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,31 +6,37 @@ describe('Navbar', () => {
66
it('should render .navbar markup', () => {
77
const wrapper = shallow(<Navbar />);
88

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

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

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

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

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

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

27-
expect(wrapper.html()).toBe('<div role="navigation" class="navbar"></div>');
27+
expect(wrapper.html()).toBe('<div class="navbar"></div>');
28+
});
29+
30+
it('should render role', () => {
31+
const wrapper = shallow(<Navbar role="navigation" />);
32+
33+
expect(wrapper.html()).toBe('<nav role="navigation" class="navbar"></nav>');
2834
});
2935

30-
it('sholid render children', () => {
36+
it('should render children', () => {
3137
const wrapper = shallow(<Navbar>Children</Navbar>);
3238

33-
expect(wrapper.html()).toBe('<nav role="navigation" class="navbar">Children</nav>');
39+
expect(wrapper.html()).toBe('<nav class="navbar">Children</nav>');
3440
});
3541

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

0 commit comments

Comments
 (0)