Skip to content

Commit

Permalink
fix(Icon): added aria-hidden attribute to icon
Browse files Browse the repository at this point in the history
  • Loading branch information
fracmak committed Dec 8, 2016
1 parent 5a1b82d commit e521bdf
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/elements/Icon/Icon.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ function Icon(props) {
const ElementType = getElementType(Icon, props)

return (
<ElementType {...rest} className={classes} />
<ElementType {...rest} aria-hidden='true' className={classes} />
)
}

Expand Down
8 changes: 8 additions & 0 deletions test/specs/elements/Icon/Icon-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,12 @@ describe('Icon', () => {
shallow(<Icon />)
.should.have.tagName('i')
})

describe('aria', () => {
it('should add aria-hidden to icon', () => {
const wrapper = shallow(<Icon />)

wrapper.should.have.prop('aria-hidden', 'true')
})
})
})

0 comments on commit e521bdf

Please sign in to comment.