-
Notifications
You must be signed in to change notification settings - Fork 152
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(axe-core-4.6): update to axe-core 4.6.3, promote link-in-text-bl…
…ock and meta-viewport (#6334) #### Details This PR updates `axe-core` to its latest version, 4.6.2, from 4.4.1. Notable code changes beyond the simple version bump include: * `link-in-text-block` failures have been promoted from "needs review" to "automated checks" (removed from needs review with explicit code change, added to automated checks implicitly due to new axe-core tagging) * `meta-viewport` failures have been promoted from "unreported" to "automated checks" (implicitly due to new axe-core tagging) * WCAG mappings for a few rules have changed (we pull these automatically from axe-core's tags, so there is no corresponding code change) * Per discussion with PM, `link-in-text-block` incomplete results are staying unreported (not being promoted to "needs review") * `frame-title-unique` and `no-autoplay-audio` are explicitly disabled. They were promoted in axe-core from experimental/best-practice to "wcag-correspondant, but needs-review-only", but we want to omit them from our needs review checks pending further investigation ##### Motivation See 1960423 ##### Context * We are considering a separate PR to pull in a temporary version of the `aria-required-children` message improvements we've suggested upstream as [axe-core#3842](dequelabs/axe-core#3842) (which would hopefully be removed later once we update to axe-core 4.7). Leaving that for a separate PR. * While testing this locally, I noticed an issue where the target page console would show an error during scans suggesting axe-core scans were being run multiple times concurrently. I also observed this is `main` without this PR - I don't think it's a regression and will be following up separately. #### Pull request checklist <!-- If a checklist item is not applicable to this change, write "n/a" in the checkbox --> - [x] Addresses an existing issue: 1960423 - [x] Ran `yarn fastpass` - [x] Added/updated relevant unit test(s) (and ran `yarn test`) - [x] Verified code coverage for the changes made. Check coverage report at: `<rootDir>/test-results/unit/coverage` - [x] PR title *AND* final merge commit title both start with a semantic tag (`fix:`, `chore:`, `feat(feature-name):`, `refactor:`). See `CONTRIBUTING.md`. - [n/a] (UI changes only) Added screenshots/GIFs to description above - [n/a] (UI changes only) Verified usability with NVDA/JAWS --------- Co-authored-by: JGibson2019 <jacqueline.gibson@microsoft.com> Co-authored-by: SB <shanisebarona@gmail.com>
- Loading branch information
1 parent
c8a46ad
commit ed75fda
Showing
23 changed files
with
135 additions
and
147 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. | ||
import { Result } from 'axe-core'; | ||
import { AxeInfo } from '../../common/axe-info'; | ||
|
||
const axeInfo = AxeInfo.Default; | ||
|
||
// this is a method to remove violations tied to rules with known false-positives and was introduced | ||
// Jan 25 2023 to remove aria-required-children failures introduced by axe-core 4.6.1 | ||
// we should keep this in until Deque introduces the fix for the issues tracked here | ||
// https://github.com/dequelabs/axe-core/issues/3850 | ||
// the axe-core bug causes a failure for the FluentUI v8 DetailsList component | ||
// The FluentUI tracking issue can be found here: | ||
// https://github.com/microsoft/fluentui/issues/26330 | ||
export function falsePositiveRemoval(violations: Result[]): Result[] { | ||
// Re-evaluate if the false positive is still present in future axe-core versions | ||
if (axeInfo.version !== '4.6.3') { | ||
throw new Error('Axe Core version has changed. Please check if this is still needed'); | ||
} | ||
let newViolations = violations.map(function (violation) { | ||
if (violation.id === 'aria-required-children') { | ||
const newNodes = violation.nodes.filter( | ||
node => | ||
!( | ||
node.html.includes('ms-DetailsHeader') || | ||
node.html.includes('ms-DetailsRow') | ||
), | ||
); | ||
violation.nodes = newNodes; | ||
} | ||
return violation; | ||
}); | ||
newViolations = newViolations.filter(violation => violation.nodes.length > 0); | ||
return newViolations; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 2 additions & 32 deletions
34
src/tests/end-to-end/tests/details-view/__snapshots__/instructions.test.ts.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,5 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`Details View -> Quick Assess -> Instructions Requirement page should pass accessibility validation with highContrastMode=false 1`] = ` | ||
[ | ||
{ | ||
"id": "label-content-name-mismatch", | ||
"nodes": [ | ||
{ | ||
"failureSummary": "Fix any of the following: | ||
Text inside the element is not included in the accessible name", | ||
"selector": [ | ||
"#header61-visualizationButton", | ||
], | ||
}, | ||
], | ||
}, | ||
] | ||
`; | ||
exports[`Details View -> Quick Assess -> Instructions Requirement page should pass accessibility validation with highContrastMode=false 1`] = `[]`; | ||
|
||
exports[`Details View -> Quick Assess -> Instructions Requirement page should pass accessibility validation with highContrastMode=true 1`] = ` | ||
[ | ||
{ | ||
"id": "label-content-name-mismatch", | ||
"nodes": [ | ||
{ | ||
"failureSummary": "Fix any of the following: | ||
Text inside the element is not included in the accessible name", | ||
"selector": [ | ||
"#header61-visualizationButton", | ||
], | ||
}, | ||
], | ||
}, | ||
] | ||
`; | ||
exports[`Details View -> Quick Assess -> Instructions Requirement page should pass accessibility validation with highContrastMode=true 1`] = `[]`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.