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: update toHaveNoAxeViolations and remove skips #5955

Merged

Conversation

lee-chase
Copy link
Member

Updates toHaveNoAxeViolations and fixes a small number of use cases.

What did you change?

The function was creating a new Promise which is not necessary, refactored.

Not entirely sure the async/await is doing much in the tests that were refactored, but with async tests the accessible checks need to be waited for when there are multiple uses of the accessible matchers.

How did you test and verify your work?

Ran the tests.

@lee-chase lee-chase requested a review from a team as a code owner August 27, 2024 14:19
@lee-chase lee-chase requested review from elycheea and devadula-nandan and removed request for a team August 27, 2024 14:19
Copy link

netlify bot commented Aug 27, 2024

Deploy Preview for carbon-for-ibm-products ready!

Name Link
🔨 Latest commit 4b4292a
🔍 Latest deploy log https://app.netlify.com/sites/carbon-for-ibm-products/deploys/66cdf28ac17f5e0008eae994
😎 Deploy Preview https://deploy-preview-5955--carbon-for-ibm-products.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link
Contributor

@amal-k-joy amal-k-joy left a comment

Choose a reason for hiding this comment

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

LGTM

@elycheea , @lee-chase
Looks like we have not added await in most of our accessibility test cases across components (eg: AboutModal.test, AddSelect.test ...)
Do we need to create an new issue to add await ?

 it('has no accessibility violations', async () => {
    const { container } = render(<AddSelect {...defaultProps} />);
    expect(container).toBeAccessible(componentName);
    expect(container).toHaveNoAxeViolations();
  });

@lee-chase
Copy link
Member Author

LGTM

@elycheea , @lee-chase Looks like we have not added await in most of our accessibility test cases across components (eg: AboutModal.test, AddSelect.test ...) Do we need to create an new issue to add await ?

 it('has no accessibility violations', async () => {
    const { container } = render(<AddSelect {...defaultProps} />);
    expect(container).toBeAccessible(componentName);
    expect(container).toHaveNoAxeViolations();
  });

@amal-k-joy it only seems to be needed if you want to run multiple accessibility tests from within the same module.

Copy link
Contributor

@elycheea elycheea left a comment

Choose a reason for hiding this comment

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

Thank you for cleaning up those .skip()s! 🙏

@elycheea elycheea added this pull request to the merge queue Sep 3, 2024
Merged via the queue into carbon-design-system:main with commit 694128b Sep 3, 2024
21 of 22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants