StackExchange / Stacks

Stack Overflow’s Design System
https://stackoverflow.design
MIT License
610 stars 89 forks source link

test(a11y): add ability to pass custom APCA threshold to axe-apca #1487

Closed dancormier closed 1 year ago

dancormier commented 1 year ago

Addresses STACKS-388.

This PR modifies registerAxeAPCA to:

  1. Accept custom as a conformance level
  2. Accept an optional custom threshold function for the second argument

It also updates lib/test/test-utils.ts to use a custom APCA threshold of Lc 60 for all fontSize < 32.

netlify[bot] commented 1 year ago

Deploy Preview for stacks ready!

Name Link
Latest commit ddb399cb2f2df85d4511af07bb52ce4a9988446a
Latest deploy log https://app.netlify.com/sites/stacks/deploys/65006cdddb270c0007bd6a1b
Deploy Preview https://deploy-preview-1487--stacks.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.

dancormier commented 1 year ago

The only comment I have is that by relaxing the threshold we might have actually quite a few skipped tests now that they don't need to be skipped anymore. I am not sure how relevant it is at this stage is to unskip them given that we will eventually merge the stacks-next branch. The only benefits I see is if we want to have a comparison on number of custom apca failures for v1 vs v2. I will leave that decision up to you.

Before merging in stacks-next (or retroactively), I plan on getting a final v1 vs v2 test failure comparison. At this stage, that number is heavily in flux as we add new tests in tandem with our color initiative work, so I don't feel capturing a number now would be a good point of comparison. Similarly, we could comb through and see which tests now pass, but I don't quite think the juice is worth the squeeze on that one.