Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix accessibility violations in List Storybook #6861

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

navedqb
Copy link

@navedqb navedqb commented Jul 4, 2023

What does this PR do?

Fixes accessibility violations in 2 List storybooks

Where should the reviewer start?

List component storybooks

What testing has been done on this PR?

How should this be manually tested?

  • List/Pinned
  • List/Order

Do Jest tests follow these best practices?

  • screen is used for querying.
  • The correct query is used. (Refer to this list of queries)
  • userEvent is used in place of fireEvent.
  • asFragment() is used for snapshot testing.

Any background context you want to provide?

What are the relevant issues?

#6124

Screenshots (if appropriate)

Do the grommet docs need to be updated?

Should this PR be mentioned in the release notes?

Is this change backwards compatible or is it a breaking change?

Copy link
Collaborator

@jcfilben jcfilben left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like when List has onClickItem or onOrder defined the role of the list component is set to 'listbox' I think we should always have role='list' regardless of onClickItem or onOrder. I think we can make this change in the List.js file (see line 222).

@jcfilben
Copy link
Collaborator

jcfilben commented Jul 6, 2023

It looks like some of the List tests are failing because they are trying to reference the 'listbox' role. We should change those tests to use screen.getByRole('list') (See List/__tests__/List-test.js).

The test snapshots will also need updated. To do this you can run yarn jest -u.

@jcfilben jcfilben added the waiting Awaiting response to latest comments label Jul 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
waiting Awaiting response to latest comments
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants