Skip to content

Commit

Permalink
feat(NavbarToggler): add aria-label to NavbarToggler
Browse files Browse the repository at this point in the history
This adds the aria-label to the NavbarToggler as
seen in the bootstrap docs.

Fixes #1632
  • Loading branch information
glenp01 committed Sep 25, 2019
1 parent de5f482 commit 93ee141
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/NavbarToggler.js
Expand Up @@ -31,7 +31,7 @@ const NavbarToggler = (props) => {
), cssModule);

return (
<Tag {...attributes} className={classes}>
<Tag {...attributes} className={classes} aria-label="Toggle navigation">
{children || <span className={mapToCssModules('navbar-toggler-icon', cssModule)} />}
</Tag>
);
Expand Down
3 changes: 2 additions & 1 deletion src/__tests__/NavbarToggler.spec.js
Expand Up @@ -5,7 +5,8 @@ import { NavbarToggler } from '../';
describe('NavbarToggler', () => {
it('should render .navbar-toggler markup', () => {
const wrapper = shallow(<NavbarToggler />);


expect(wrapper.prop('aria-label')).toBe('Toggle navigation');
expect(wrapper.html()).toBe('<button type="button" class="navbar-toggler"><span class="navbar-toggler-icon"></span></button>');
});

Expand Down

0 comments on commit 93ee141

Please sign in to comment.