Skip to content

[Tests] Ensure that axe calls are made on open state of the component #4530

Description

@khiga8

Hi! I noticed that in the component snapshot tests, axe scans are made on the default state of the component.

For example, in ActionMenu, the scan axe call is made like so:

        test('axe @aat', async ({page}) => {
          await visit(page, {
            id: 'components-actionmenu-examples--groups-and-descriptions',
            globals: {
              colorScheme: theme,
            },
          })
          await expect(page).toHaveNoViolations({
            rules: {
              'aria-required-children': {
                enabled: false,
              },
            },
          })
        })

Axe is being called on the closed state of the menu - Example snapshot, which does not provide as much value because we're essentially running an axe scan on a button, rather than on the menu markup that is only visible open activating the toggle.

Instead (or in addition to what we currently have), I believe we would want the axe scans to happen on the open state of the menu. I observed this in other "popover" type components like Dialog as well.

We should update these tests to have the axe scan run on the open state.

Stretch: It would be great if we could have some kind of automated check that ensures that we have axe scan coverage on the open state of components.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions