Skip to content

Commit

Permalink
feat(ScrollButton): Add aria attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
m7kvqbe1 committed Jul 15, 2020
1 parent 86ab25f commit c8f2d4d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ export const ScrollButton: React.FC<ScrollButtonProps> = ({
<button
className={classes}
onClick={onClick}
aria-hidden
data-testid={`scroll-${direction}`}
>
{SCROLL_DIRECTION_ICON_MAP[direction]}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,11 @@ describe('TabSet', () => {
)
})

it('should add the `aria-hidden` attribute', () => {
expect(wrapper.getByTestId('scroll-left')).toHaveAttribute('aria-hidden')
expect(wrapper.getByTestId('scroll-right')).toHaveAttribute('aria-hidden')
})

it('should present a scroll left button', () => {
expect(wrapper.getByTestId('scroll-left')).toBeInTheDocument()
})
Expand Down

0 comments on commit c8f2d4d

Please sign in to comment.