diff --git a/package.json b/package.json index 0825747a1e..94f10c6ca7 100644 --- a/package.json +++ b/package.json @@ -154,7 +154,7 @@ "@fluentui/react": "^8.96.1", "@microsoft/applicationinsights-web": "^2.8.11", "ajv": "^8.12.0", - "axe-core": "4.6.3", + "axe-core": "4.7.2", "classnames": "^2.3.2", "idb-keyval": "^6.2.1", "lodash": "^4.17.21", diff --git a/packages/report/package.json b/packages/report/package.json index ef48dc1cce..004d823330 100644 --- a/packages/report/package.json +++ b/packages/report/package.json @@ -1,6 +1,6 @@ { "name": "accessibility-insights-report", - "version": "4.6.7", + "version": "4.7.2", "description": "Accessibility Insights Report", "license": "MIT", "files": [ @@ -19,7 +19,7 @@ }, "dependencies": { "@fluentui/react": "^8.96.1", - "axe-core": "4.6.3", + "axe-core": "4.7.2", "classnames": "^2.3.2", "lodash": "^4.17.21", "luxon": "^3.3.0", diff --git a/packages/ui/package.json b/packages/ui/package.json index c93703d7bd..722e61cc4a 100644 --- a/packages/ui/package.json +++ b/packages/ui/package.json @@ -18,7 +18,7 @@ }, "dependencies": { "@fluentui/react": "^8.96.1", - "axe-core": "4.6.3", + "axe-core": "4.7.2", "classnames": "^2.3.2", "lodash": "^4.17.21", "luxon": "^3.3.0", diff --git a/src/DetailsView/components/load-assessment-data-schema-provider.ts b/src/DetailsView/components/load-assessment-data-schema-provider.ts index d23ef7a008..9f0e6f20f9 100644 --- a/src/DetailsView/components/load-assessment-data-schema-provider.ts +++ b/src/DetailsView/components/load-assessment-data-schema-provider.ts @@ -22,8 +22,8 @@ export class LoadAssessmentDataSchemaProvider { private setDeprecatedRequirementProperties(schema: any) { const deprecatedRequirements = [ + { assessmentKey: 'automated-checks', requirementKey: 'aria-roledescription' }, { assessmentKey: 'automated-checks', requirementKey: 'duplicate-id' }, - { assessmentKey: 'automated-checks', requirementKey: 'scrollable-region-focusable' }, ]; deprecatedRequirements.forEach(requirement => { if (this.getAssessments(schema)[requirement.assessmentKey] === undefined) { diff --git a/src/common/components/cards/rich-resolution-content.tsx b/src/common/components/cards/rich-resolution-content.tsx index 4ac98fe6e0..aa2fcb4af6 100644 --- a/src/common/components/cards/rich-resolution-content.tsx +++ b/src/common/components/cards/rich-resolution-content.tsx @@ -80,14 +80,6 @@ export const RichResolutionContent = NamedFC( ); } - case 'web/scrollable-region-focusable': { - return ( - - Examine the element and ensure that, if there is scrollable content, the - elements are accessible by keyboard. - - ); - } case 'web/label-content-name-mismatch': { return ( diff --git a/src/scanner/get-rule-inclusions.ts b/src/scanner/get-rule-inclusions.ts index 2de97d1769..7eedc7af57 100644 --- a/src/scanner/get-rule-inclusions.ts +++ b/src/scanner/get-rule-inclusions.ts @@ -47,10 +47,6 @@ export const explicitRuleOverrides: DictionaryStringTo = { status: 'included', reason: 'best practice rule that was investigated with no known false positives, implemented as an automated check.', }, - 'scrollable-region-focusable': { - status: 'excluded', - reason: 'only reports to needs-review results due to potential false-positives', - }, }; // all the rules we enable in needs review @@ -58,7 +54,6 @@ export const needsReviewRules = [ 'aria-input-field-name', 'color-contrast', 'th-has-data-cells', - 'scrollable-region-focusable', 'label-content-name-mismatch', 'p-as-heading', ]; diff --git a/src/tests/common/false-positive-violations.ts b/src/tests/common/false-positive-violations.ts deleted file mode 100644 index 1976b4cb6b..0000000000 --- a/src/tests/common/false-positive-violations.ts +++ /dev/null @@ -1,35 +0,0 @@ -// 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; -} diff --git a/src/tests/end-to-end/common/scan-for-accessibility-issues.ts b/src/tests/end-to-end/common/scan-for-accessibility-issues.ts index 4cd5f8eaa3..e89ef0739e 100644 --- a/src/tests/end-to-end/common/scan-for-accessibility-issues.ts +++ b/src/tests/end-to-end/common/scan-for-accessibility-issues.ts @@ -4,7 +4,6 @@ import * as path from 'path'; import { AxeResults, ElementContext } from 'axe-core'; import { getNeedsReviewRulesConfig } from 'scanner/get-rule-inclusions'; -import { falsePositiveRemoval } from '../../common/false-positive-violations'; import { Page } from './page-controllers/page'; import { prettyPrintAxeViolations, PrintableAxeResult } from './pretty-print-axe-violations'; @@ -25,7 +24,6 @@ export async function scanForAccessibilityIssues( }, { selector, rules: getNeedsReviewRulesConfig() }, )) as AxeResults; - axeResults.violations = falsePositiveRemoval(axeResults.violations); return prettyPrintAxeViolations(axeResults); } diff --git a/src/tests/end-to-end/tests/popup/__snapshots__/launchpad.test.ts.snap b/src/tests/end-to-end/tests/popup/__snapshots__/launchpad.test.ts.snap index be4c717b82..dd0f3d41fb 100644 --- a/src/tests/end-to-end/tests/popup/__snapshots__/launchpad.test.ts.snap +++ b/src/tests/end-to-end/tests/popup/__snapshots__/launchpad.test.ts.snap @@ -247,7 +247,7 @@ exports[`Popup -> Launch Pad content should match snapshot when quick assess fea Navigate to axe-core npm page - 4.6.3 + 4.7.2 @@ -545,7 +545,7 @@ exports[`Popup -> Launch Pad content should match snapshot when quick assess fea Navigate to axe-core npm page - 4.6.3 + 4.7.2 diff --git a/src/tests/unit/tests/DetailsView/components/load-assessment-data-schema-provider.test.ts b/src/tests/unit/tests/DetailsView/components/load-assessment-data-schema-provider.test.ts index 5d9ed21955..5bd2102a66 100644 --- a/src/tests/unit/tests/DetailsView/components/load-assessment-data-schema-provider.test.ts +++ b/src/tests/unit/tests/DetailsView/components/load-assessment-data-schema-provider.test.ts @@ -66,8 +66,8 @@ describe(LoadAssessmentDataSchemaProvider, () => { properties: assessment.key === 'automated-checks' ? { + 'aria-roledescription': stepProperties, 'duplicate-id': stepProperties, - 'scrollable-region-focusable': stepProperties, } : {}, type: ['object', 'null'], @@ -78,8 +78,8 @@ describe(LoadAssessmentDataSchemaProvider, () => { properties: assessment.key === 'automated-checks' ? { + 'aria-roledescription': statusProperties, 'duplicate-id': statusProperties, - 'scrollable-region-focusable': statusProperties, } : {}, type: ['object', 'null'], diff --git a/src/tests/unit/tests/common/components/cards/__snapshots__/rich-resolution-content.test.tsx.snap b/src/tests/unit/tests/common/components/cards/__snapshots__/rich-resolution-content.test.tsx.snap index da6da4ee8b..0b06adafff 100644 --- a/src/tests/unit/tests/common/components/cards/__snapshots__/rich-resolution-content.test.tsx.snap +++ b/src/tests/unit/tests/common/components/cards/__snapshots__/rich-resolution-content.test.tsx.snap @@ -84,12 +84,6 @@ exports[`RichResolutionContent renders static content with id=web/p-as-heading 1 `; -exports[`RichResolutionContent renders static content with id=web/scrollable-region-focusable 1`] = ` - - Examine the element and ensure that, if there is scrollable content, the elements are accessible by keyboard. - -`; - exports[`RichResolutionContent renders static content with id=web/th-has-data-cells 1`] = `
Examine the header cell in the context of the table to verify that it has no data cells. diff --git a/src/tests/unit/tests/common/components/cards/rich-resolution-content.test.tsx b/src/tests/unit/tests/common/components/cards/rich-resolution-content.test.tsx index f2976ef9a7..2569a0bf7e 100644 --- a/src/tests/unit/tests/common/components/cards/rich-resolution-content.test.tsx +++ b/src/tests/unit/tests/common/components/cards/rich-resolution-content.test.tsx @@ -19,7 +19,6 @@ describe('RichResolutionContent', () => { 'web/aria-input-field-name', 'web/color-contrast', 'web/th-has-data-cells', - 'web/scrollable-region-focusable', 'web/label-content-name-mismatch', 'web/p-as-heading', ])('renders static content with id=%s', testId => { diff --git a/src/tests/unit/tests/common/self-fast-pass.test.ts b/src/tests/unit/tests/common/self-fast-pass.test.ts index f73f8d4505..3827050694 100644 --- a/src/tests/unit/tests/common/self-fast-pass.test.ts +++ b/src/tests/unit/tests/common/self-fast-pass.test.ts @@ -71,7 +71,6 @@ describe('SelfFastPass', () => { 'aria-input-field-name', 'color-contrast', 'th-has-data-cells', - 'scrollable-region-focusable', 'label-content-name-mismatch', 'p-as-heading', ], diff --git a/src/tests/unit/tests/scanner/__snapshots__/get-rule-inclusions.test.ts.snap b/src/tests/unit/tests/scanner/__snapshots__/get-rule-inclusions.test.ts.snap index a4a5258bd5..432906d8bf 100644 --- a/src/tests/unit/tests/scanner/__snapshots__/get-rule-inclusions.test.ts.snap +++ b/src/tests/unit/tests/scanner/__snapshots__/get-rule-inclusions.test.ts.snap @@ -48,7 +48,8 @@ exports[`getRuleInclusions getRuleInclusions matches snapshotted list of product "status": "included", }, "aria-roledescription": { - "status": "included", + "reason": "disabled in axe config", + "status": "excluded", }, "aria-roles": { "status": "included", @@ -296,8 +297,7 @@ exports[`getRuleInclusions getRuleInclusions matches snapshotted list of product "status": "excluded", }, "scrollable-region-focusable": { - "reason": "only reports to needs-review results due to potential false-positives", - "status": "excluded", + "status": "included", }, "select-name": { "status": "included", diff --git a/yarn.lock b/yarn.lock index e1ac5178b1..cdd59b0efa 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2750,7 +2750,7 @@ __metadata: resolution: "accessibility-insights-report@workspace:packages/report" dependencies: "@fluentui/react": ^8.96.1 - axe-core: 4.6.3 + axe-core: 4.7.2 classnames: ^2.3.2 lodash: ^4.17.21 luxon: ^3.3.0 @@ -2766,7 +2766,7 @@ __metadata: resolution: "accessibility-insights-ui@workspace:packages/ui" dependencies: "@fluentui/react": ^8.96.1 - axe-core: 4.6.3 + axe-core: 4.7.2 classnames: ^2.3.2 lodash: ^4.17.21 luxon: ^3.3.0 @@ -2806,7 +2806,7 @@ __metadata: "@typescript-eslint/eslint-plugin": ^5.61.0 "@typescript-eslint/parser": ^6.2.1 ajv: ^8.12.0 - axe-core: 4.6.3 + axe-core: 4.7.2 case-sensitive-paths-webpack-plugin: ^2.4.0 classnames: ^2.3.2 codecov: ^3.8.3 @@ -3304,10 +3304,10 @@ __metadata: languageName: node linkType: hard -"axe-core@npm:4.6.3": - version: 4.6.3 - resolution: "axe-core@npm:4.6.3" - checksum: d0c46be92b9707c48b88a53cd5f471b155a2bfc8bf6beffb514ecd14e30b4863e340b5fc4f496d82a3c562048088c1f3ff5b93b9b3b026cb9c3bfacfd535da10 +"axe-core@npm:4.7.2": + version: 4.7.2 + resolution: "axe-core@npm:4.7.2" + checksum: 5d86fa0f45213b0e54cbb5d713ce885c4a8fe3a72b92dd915a47aa396d6fd149c4a87fec53aa978511f6d941402256cfeb26f2db35129e370f25a453c688655a languageName: node linkType: hard