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

Menubar Navigation Example: Make single page and improve implementation of APG coding practices #1612

Closed
wants to merge 59 commits into from

Conversation

jongund
Copy link
Contributor

@jongund jongund commented Nov 11, 2020

Update to menubar navigation example is ready for review:

Preview Link

Changes:

  • Added landmark regions to mimic a website look and feel
  • When links selected the content area is updated and the focus moves to the H1 element, previous version went to a dummy link
  • Updated code to use coding practices

Review checklist

@github-actions
Copy link
Contributor

github-actions bot commented Nov 11, 2020

Regression test coverage:

Examples without any regression tests:

  • dialog-modal/alertdialog.html

Examples missing some regression tests:

  • dialog-modal/datepicker-dialog.html:
    • textbox-aria-describedby
  • menu-button/menu-button-actions-active-descendant.html:
    • menu-up-arrow
    • menu-down-arrow
    • menu-character
  • menubar/menubar-navigation.html:
    • menubar-space-or-enter
    • menubar-right-arrow
    • menubar-left-arrow
    • menubar-down-arrow
    • menubar-up-arrow
    • menubar-home
    • menubar-end
    • menubar-character
    • submenu-space-or-enter
    • submenu-escape
    • submenu-right-arrow
    • submenu-left-arrow
    • submenu-down-arrow
    • submenu-up-arrow
    • submenu-home
    • submenu-end
    • submenu-character
    • menubar-menuitem-aria-current
    • menu-menuitem-role
    • menu-menuitem-tabindex
  • toolbar/toolbar.html:
    • toolbar-tab
    • toolbar-right-arrow
    • toolbar-left-arrow
    • toolbar-home
    • toolbar-end
    • toolbar-toggle-esc
    • toolbar-toggle-enter-or-space
    • toolbar-radio-enter-or-space
    • toolbar-radio-down-arrow
    • toolbar-radio-up-arrow
    • toolbar-button-enter-or-space
    • toolbar-menubutton-enter-or-space-or-down-or-up
    • toolbar-menu-enter-or-space
    • toolbar-menu-down-arrow
    • toolbar-menu-up-arrow
    • toolbar-menu-escape
    • toolbar-spinbutton-down-arrow
    • toolbar-spinbutton-up-arrow
    • toolbar-spinbutton-page-down
    • toolbar-spinbutton-page-up
    • toolbar-checkbox-space
    • toolbar-link-enter-or-space
    • toolbar-spinbutton-role

Example pages with Keyboard or Attribute table rows that do not have data-test-ids:

  • dialog-modal/alertdialog.html
    • "Keyboard Support" table(s):
      • Tab
      • Shift + Tab
      • Escape
      • Command + S
      • Control + S
    • "Attributes" table(s):
      • alertdialog
      • aria-labelledby=IDREF
      • aria-describedby=IDREF
      • aria-modal=true
      • alert

SUMMARY:

52 example pages found.
1 example pages have no regression tests.
4 example pages are missing approximately 47 out of approximately 790 tests.

ERROR - missing tests:

Please write missing tests for this report to pass.

this.fillerTextSentences.push(
'The content on this page is associated with the <a href="$linkURL">$linkName</a> link for <a href="$siteURL">$siteName</a>.'
);
// this.fillerTextSentences.push('The text content in this paragraph is filler text providing a detectable change of content when the <a href="$linkURL">$linkName</a> link is selected from the menu. ');
Copy link
Contributor

Choose a reason for hiding this comment

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

Delete commend out code?

}
);

/*
Copy link
Contributor

Choose a reason for hiding this comment

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

This comments out most 90% of the tests

Copy link
Contributor Author

Choose a reason for hiding this comment

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

delete the commented code

Copy link
Contributor

Choose a reason for hiding this comment

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

Think this comment was for the other line

@mcking65 mcking65 changed the title updated menubar navigation example Menubar Navigation Example: Make single page and improve implementation of APG coding practices Nov 13, 2020
@mcking65
Copy link
Contributor

@jongund
The changes make this really nice and clean. I've only tried with JAWS so far. At least with JAWS, the experience of activating a menu item is really good.

I'll work on cautionary text for the intro.

Could you please update the HCM documentation to use the language we just put in menubutton?

@jongund
Copy link
Contributor Author

jongund commented Dec 16, 2020

@mcking65
I have updated the regression tests and the accessibility documentation.
So ready for review.

Copy link
Contributor

@spectranaut spectranaut left a comment

Choose a reason for hiding this comment

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

These tests are so comprehensive! Just a few comments on the helper functions.

The code looks good too, this is an approving code review.

@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
Copy link
Contributor

Choose a reason for hiding this comment

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

I think you can delete this file, now that you have moved the svg definition into the css! :)

*
* @returns {Promise} Resolves to array of elements
*/
module.exports = async function queryElements(t, selector, context) {
module.exports = async function queryElements(t, selector, context, noTest) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we should probably add an "options" object with { allowNoResults : true }. The pattern you used is called a "boolean trap" and it's very hard to understand when reading the code.

Just a heads up: We also created this function queryElements to make sure that we don't have false positives in tests, especially when we are testing in a loop. If we are looping over elements returned by queryElements to test each element, but the css selector was incorrect, then we never enter the loop and the test false passes!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@spectranaut
I don't need the change anymore, no need for no result option.

* @param {String} elementSelector - the element with aria-owns set
*/

module.exports = async function assertAriaOwns(t, elementSelector) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I appreciate this addition to the helper functions! But I noticed you don't actually use it in your test...? You could use it for the menubar-menuitem-aria-owns test

const assertAriaRoles = require('../util/assertAriaRoles');
const assertRovingTabindex = require('../util/assertRovingTabindex');
const assertAriaOwns = require('../util/assertAriaOwns');
Copy link
Contributor

Choose a reason for hiding this comment

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

Looks like you don't use this?

@jongund
Copy link
Contributor Author

jongund commented Jan 28, 2021

@nschonni
This pull request has the same problem as some other that I have had relating to changes in the examples\index.html file. While I didn't change it in the this pull request, I did delete and change the names of some example files. What needs to happen to get the GitHub regression test passing for index.html.

@nschonni
Copy link
Contributor

@jongund it looks like the examples index is ok here, except that there are git conflicts in a few files

@jongund
Copy link
Contributor Author

jongund commented Jan 28, 2021

This pull request is now part of pull #1741.

@mcking65
Copy link
Contributor

mcking65 commented Feb 3, 2021

@jongund I assume it is OK to delete this branch?

@jongund
Copy link
Contributor Author

jongund commented Feb 3, 2021

@mcking65
Yes, this branch can be deleted.
Do you want me to delete other stale or outdated branches I create?

@mcking65 mcking65 deleted the update-menubar-nav branch February 9, 2021 05:30
@mcking65
Copy link
Contributor

mcking65 commented Feb 9, 2021

@jongund yes, it is helpful to delete branches you create and are no longer needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants