Skip to content

Adding a11y tests and moving from whitelist to blacklist + misc fixes - #3502

Merged
cchaos merged 11 commits into
elastic:masterfrom
myasonik:adding-tests
Jun 4, 2020
Merged

cchaos merged 11 commits into
elastic:masterfrom
myasonik:adding-tests

Conversation

@myasonik

@myasonik myasonik commented May 19, 2020 •

Copy link
Copy Markdown
Contributor

Summary

This PR does 2 things.

  1. Removes menu and menuitem roles from KeyPadMenu and KeyPadMenuItem.
    • These roles are super specific and shouldn't be used for generic lists of links. We also weren't implementing any of the expected keyboard functionality for them so they weren't technically complete either.
  2. Changes our a11y testing strategy from a whitelist of pages to test to a blacklist of pages to skip.
    • We weren't adding new pages that we were adding to the automated testing making it increasingly difficult to catch up. Switching to a blacklist means that new pages are automatically tested.
    • Added several new pages to the tests: Header, Key Pad Menu, Data Grid Focus, Comment List, Image, Tour, Filter Group, Beacon, Highlight and Mark, HTML ID Generator, Overlay Mask, Changelog (Making progress on [Meta][Docs] Add automated tests for all pages #2679)

Checklist

- [ ] Check against all themes for compatibility in both light and dark modes
- [ ] Checked in mobile
- [ ] Checked in IE11 and Firefox
- [ ] Props have proper autodocs
- [ ] Added documentation examples

  • Added or updated jest tests
  • Checked for breaking changes and labeled appropriately
  • Checked for accessibility including keyboard-only and screenreader modes
  • A changelog entry exists and is marked appropriately

@myasonik myasonik added chore accessibility testing Issues or PRs that only affect tests - will not need changelog entries labels May 19, 2020
@kibanamachine

Copy link
Copy Markdown
Contributor

@cchaos

cchaos commented May 20, 2020

Copy link
Copy Markdown
Contributor

The title of this PR could be more specific.

  1. Removes menu and menuitem roles from KeyPadMenu and KeyPadMenuItem.

I think this is fine and agree that it's not correct for all implementations. I think we should also then add some accessibility guidelines to their docs page around what to add if:
a. It's used as the primary navigation for the site/app
b. It's used in a menu-like dropdown with selection (there's a selected item)

  1. Changes our a11y testing strategy from a whitelist of pages to test to a blacklist of pages to skip.

🙏 Thank you! This makes way more sense and I'm definitely in the group of people who forget to add to this list.

@myasonik myasonik changed the title Adding tests Adding a11y tests and moving from whitelist to blacklist + misc fixes May 20, 2020
@myasonik

myasonik commented May 20, 2020 •

Copy link
Copy Markdown
Contributor Author

The title of this PR could be more specific.

😆 The title of the PR was terrible. My bad, it's better now.

we should also then add some accessibility guidelines

I added a note about what to do if it's a bunch of links but I couldn't think of any good broad guidelines that I could give about the buttons use case. Anything I could think of had plenty of exceptions so I just didn't mention it. I don't think anything should be super broken if they don't do anything but it could be if they do the wrong thing so I thought rather overly simplified is better than misleading.

@kibanamachine

Copy link
Copy Markdown
Contributor

Comment thread CHANGELOG.md Resolved
Comment thread src-docs/src/views/header/header.js Resolved
);

$button.simulate('click');
$button.find('button').simulate('click');

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

To make the test read more appropriately can you change the const name to $item instead of $button?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This also might break downstream app tests, do we then consider this a breaking change @chandlerprall ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This was reverted by moving the <li> wrapping element to the parent component

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Somehow it still exists as changed?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@myasonik Can you remove this change, it shouldn't be necessary anymore.

Michail Yasonik and others added 2 commits May 27, 2020 16:06
@kibanamachine

Copy link
Copy Markdown
Contributor

@kibanamachine

Copy link
Copy Markdown
Contributor

@kibanamachine

Copy link
Copy Markdown
Contributor

@myasonik
myasonik requested a review from cchaos May 29, 2020 21:24
@kibanamachine

Copy link
Copy Markdown
Contributor

@kibanamachine

Copy link
Copy Markdown
Contributor

@cchaos

cchaos commented Jun 3, 2020 •

Copy link
Copy Markdown
Contributor

Looks like there's another/new a11y issue:

16:51:29 Errors on tp://localhost:9999/#/layout/header
16:51:29 [landmark-unique]: Landmarks must have a unique role or role/label/title (i.e. accessible name) combination
16:51:29   Help: https://dequeuniversity.com/rules/axe/3.4/landmark-unique?application=axe-puppeteer
16:51:29   Elements:
16:51:29     - .euiHeaderSectionItem--borderLeft.euiHeaderSectionItem > .euiHeaderLinks[aria-label="App\ navigation"]
16:51:29     - .euiHeaderSectionItem--borderLeft.euiHeaderSectionItem > .euiHeaderLinks[aria-label="App\ navigation"] > .euiHeaderLinks__list[role="navigation"]
16:58:54 1 accessibility errors

Probably my bad...

@kibanamachine

Copy link
Copy Markdown
Contributor

@cchaos cchaos left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks! LGTM!

@cchaos
cchaos merged commit a6e49f0 into elastic:master Jun 4, 2020
@myasonik myasonik mentioned this pull request Jun 4, 2020
16 of 26 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

accessibility chore testing Issues or PRs that only affect tests - will not need changelog entries

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants