Skip to content

Commit

Permalink
feat(Masthead): Make avatar accessible
Browse files Browse the repository at this point in the history
  • Loading branch information
thyhjwb6 committed Sep 3, 2020
1 parent 0b5f527 commit 130cf24
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -386,6 +386,13 @@ describe('Masthead', () => {
expect(wrapper.getByText('AB')).toBeInTheDocument()
})

it('should set the `aria-label` attribute on the search button to `Show search`', () => {
expect(wrapper.queryByTestId('user-button')).toHaveAttribute(
'aria-label',
'Show user options'
)
})

it('should not show the links', () => {
expect(wrapper.queryByText('Profile')).toBeNull()
expect(wrapper.queryByText('Settings')).toBeNull()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,9 @@ const MastheadUserWithItems: React.FC<MastheadUserWithItemsProps> = ({
<Sheet
button={(
<SheetButton
aria-label="Show user options"
className="rn-masthead__option"
data-testid="notification-button"
data-testid="user-button"
icon={(
<Avatar
data-testid="masthead-avatar"
Expand Down

0 comments on commit 130cf24

Please sign in to comment.