Skip to content

Commit df756f3

Browse files
SaanicaGv-rakeshshv-viyada
authored
feat(axe-core 4.8): Axe core version upgrade for Web (#7274)
#### Details This PR updates axe-core to its latest version, [4.8.4](https://github.com/dequelabs/axe-core/releases/v4.8.4), from [4.7.2](https://github.com/dequelabs/axe-core/releases/v4.7.2). It also bumps the accessibility-insights-report package version. As part of the axe-core update: - The deprecate & disable duplicate-id / duplicate-id-active rule has been deprecated (dequelabs/axe-core#4071). - moved duplicate-id-aria to needs review. (dequelabs/axe-core#4075) <img width="922" alt="image" src="https://github.com/microsoft/accessibility-insights-web/assets/95463767/152c51ce-16d9-4550-aee2-6ddd8155a722"> - checks: enable help-same-as-label, but remove from rules (dequelabs/axe-core#4096) - Various improvements were made to the types. Potentially the most impactful of which is that the target and ancestry property now return as UnlabelledFrameSelector instead of as string[], - Major version upgrade 4.8.0 details https://github.com/dequelabs/axe-core/releases/tag/v4.8.0 <!-- Usually a sentence or two describing what the PR changes --> ##### Motivation This change is part of https://dev.azure.com/mseng/1ES/_workitems/edit/2157659/ ##### Context <!-- Are there any parts that you've intentionally left out-of-scope for a later PR to handle? --> <!-- Were there any alternative approaches you considered? What tradeoffs did you consider? --> #### Pull request checklist <!-- If a checklist item is not applicable to this change, write "n/a" in the checkbox --> - [ ] Addresses an existing issue: #0000 - [ ] 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`. - [ ] (UI changes only) Added screenshots/GIFs to description above - [ ] (UI changes only) Verified usability with NVDA/JAWS --------- Co-authored-by: Rakesh Shivapooja <v-rakeshsh@microsoft.com> Co-authored-by: Vikash Yadav <v-viyada@microsoft.com>
1 parent c5ef310 commit df756f3

File tree

16 files changed

+81
-17
lines changed

16 files changed

+81
-17
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@
155155
"@microsoft/applicationinsights-web": "^2.8.15",
156156
"@testing-library/user-event": "^14.5.2",
157157
"ajv": "^8.12.0",
158-
"axe-core": "4.7.2",
158+
"axe-core": "4.8.4",
159159
"classnames": "^2.5.1",
160160
"idb-keyval": "^6.2.1",
161161
"lodash": "^4.17.21",

packages/report/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
},
2020
"dependencies": {
2121
"@fluentui/react": "^8.96.1",
22-
"axe-core": "4.7.2",
22+
"axe-core": "4.8.4",
2323
"classnames": "^2.5.1",
2424
"lodash": "^4.17.21",
2525
"luxon": "^3.4.4",

packages/ui/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
},
1919
"dependencies": {
2020
"@fluentui/react": "^8.96.1",
21-
"axe-core": "4.7.2",
21+
"axe-core": "4.8.4",
2222
"classnames": "^2.5.1",
2323
"lodash": "^4.17.21",
2424
"luxon": "^3.4.4",

src/DetailsView/components/load-assessment-data-schema-provider.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ export class LoadAssessmentDataSchemaProvider {
2424
const deprecatedRequirements = [
2525
{ assessmentKey: 'automated-checks', requirementKey: 'aria-roledescription' },
2626
{ assessmentKey: 'automated-checks', requirementKey: 'duplicate-id' },
27+
{ assessmentKey: 'automated-checks', requirementKey: 'duplicate-id-active' },
28+
{ assessmentKey: 'automated-checks', requirementKey: 'duplicate-id-aria' },
2729
];
2830
deprecatedRequirements.forEach(requirement => {
2931
if (this.getAssessments(schema)[requirement.assessmentKey] === undefined) {

src/common/components/cards/rich-resolution-content.tsx

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,16 @@ export const RichResolutionContent = NamedFC<RichResolutionContentProps>(
7272
</div>
7373
);
7474
}
75+
case 'web/duplicate-id-aria': {
76+
return (
77+
<div>
78+
Document has multiple elements referenced with ARIA with the same id
79+
attribute. Examine any duplicate ID values and rename them. Duplicate IDs
80+
are common validation errors that may break the accessibility of labels,
81+
e.g., form fields, table header cells.
82+
</div>
83+
);
84+
}
7585
case 'web/th-has-data-cells': {
7686
return (
7787
<div>

src/common/configs/a11y-insights-rule-resources.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,12 @@ export const getA11yInsightsWebRuleUrl = (ruleId: string) => {
1818
const webRulesWithResources = [
1919
'aria-alt',
2020
'aria-allowed-attr',
21+
'aria-conditional-attr',
22+
'aria-deprecated-role',
2123
'aria-hidden-body',
2224
'aria-hidden-focus',
2325
'aria-input-field-name',
26+
'aria-prohibited-attr',
2427
'aria-required-attr',
2528
'aria-required-attr',
2629
'aria-required-children',

src/scanner/axe-extension.d.ts

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ declare module 'axe-core/axe' {
1212
};
1313
dom: {
1414
isVisible: Function;
15-
idrefs: (node: HTMLElement, attr: string) => HTMLElement[];
1615
};
1716
text: {
1817
accessibleText: Function;
@@ -31,6 +30,23 @@ declare module 'axe-core/axe' {
3130
// this must be surrounded by axe.setup and axe.teardown calls
3231
getSelector: (element: HTMLElement) => string;
3332
}
33+
interface Dom {
34+
isVisible: Function;
35+
idrefs: (node: HTMLElement, attr: string) => HTMLElement[];
36+
}
37+
interface Aria {
38+
label: Function;
39+
implicitRole: Function;
40+
getRolesByType: Function;
41+
lookupTable: any;
42+
}
43+
44+
interface Text {
45+
accessibleText: Function;
46+
isHumanInterpretable: Function;
47+
sanitize: Function;
48+
subtreeText: Function;
49+
}
3450

3551
const _audit: {
3652
rules: IRuleConfiguration[];

src/scanner/get-rule-inclusions.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ export const explicitRuleOverrides: DictionaryStringTo<RuleIncluded> = {
1515
status: 'included',
1616
reason: 'best practice rule that was investigated with no known false positives, implemented as an automated check.',
1717
},
18+
'aria-braille-equivalent': {
19+
status: 'excluded',
20+
reason: "only reports needs-review results, but we haven't implemented needs-review content for it yet",
21+
},
1822
'audio-caption': {
1923
status: 'included',
2024
reason: 'for parity with video-caption, which axe-core includes by default',
@@ -53,6 +57,7 @@ export const explicitRuleOverrides: DictionaryStringTo<RuleIncluded> = {
5357
export const needsReviewRules = [
5458
'aria-input-field-name',
5559
'color-contrast',
60+
'duplicate-id-aria',
5661
'th-has-data-cells',
5762
'label-content-name-mismatch',
5863
'p-as-heading',

src/tests/end-to-end/tests/popup/__snapshots__/launchpad.test.ts.snap

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ exports[`Popup -> Launch Pad content should match snapshot when quick assess fea
289289
Navigate to axe-core npm page
290290
</div>
291291
</div>
292-
4.7.2
292+
4.8.4
293293
</div>
294294
</div>
295295
</div>
@@ -587,7 +587,7 @@ exports[`Popup -> Launch Pad content should match snapshot when quick assess fea
587587
Navigate to axe-core npm page
588588
</div>
589589
</div>
590-
4.7.2
590+
4.8.4
591591
</div>
592592
</div>
593593
</div>

src/tests/unit/tests/DetailsView/components/load-assessment-data-schema-provider.test.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,8 @@ describe(LoadAssessmentDataSchemaProvider, () => {
6868
? {
6969
'aria-roledescription': stepProperties,
7070
'duplicate-id': stepProperties,
71+
'duplicate-id-active': stepProperties,
72+
'duplicate-id-aria': stepProperties,
7173
}
7274
: {},
7375
type: ['object', 'null'],
@@ -80,6 +82,8 @@ describe(LoadAssessmentDataSchemaProvider, () => {
8082
? {
8183
'aria-roledescription': statusProperties,
8284
'duplicate-id': statusProperties,
85+
'duplicate-id-active': statusProperties,
86+
'duplicate-id-aria': statusProperties,
8387
}
8488
: {},
8589
type: ['object', 'null'],

0 commit comments

Comments
 (0)