Skip to content

Commit

Permalink
deps(axe-core): upgrade to 4.2.1 (#12575)
Browse files Browse the repository at this point in the history
  • Loading branch information
connorjclark authored May 27, 2021
1 parent 2c6afcd commit b31823e
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 18 deletions.
2 changes: 1 addition & 1 deletion lighthouse-cli/test/fixtures/a11y/a11y_tester.html
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@
<section>
<div id="duplicate-id-aria" class="duplicate-id-aria"></span>
<div id="duplicate-id-aria"></div>
<div aria-labelledby="duplicate-id-aria"></div>
<input type="text" aria-labelledby="duplicate-id-aria"/>
</section>
<p>form-field-multiple-labels</p>
<section>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ const expectations = [
},
'selector': 'body > section > div > div#aria-treeitem-name',
'snippet': '<div id="aria-treeitem-name" role="treeitem">',
'explanation': 'Fix any of the following:\n Element does not have text that is visible to screen readers\n aria-labelledby attribute does not exist, references elements that do not exist or references elements that are empty\n aria-label attribute does not exist or is empty\n Element has no title attribute',
'explanation': 'Fix any of the following:\n Element does not have text that is visible to screen readers\n aria-label attribute does not exist or is empty\n aria-labelledby attribute does not exist, references elements that do not exist or references elements that are empty\n Element has no title attribute',
'nodeLabel': 'div',
},
},
Expand All @@ -154,7 +154,7 @@ const expectations = [
},
'selector': 'body > section > div#aria-command-name',
'snippet': '<div id="aria-command-name" role="button">',
'explanation': 'Fix any of the following:\n aria-label attribute does not exist or is empty\n aria-labelledby attribute does not exist, references elements that do not exist or references elements that are empty\n Element has no title attribute\n Element does not have text that is visible to screen readers',
'explanation': 'Fix any of the following:\n Element does not have text that is visible to screen readers\n aria-label attribute does not exist or is empty\n aria-labelledby attribute does not exist, references elements that do not exist or references elements that are empty\n Element has no title attribute',
'nodeLabel': 'div',
},
},
Expand All @@ -174,7 +174,7 @@ const expectations = [
},
'selector': 'body > section > div#aria-tooltip-name',
'snippet': '<div id="aria-tooltip-name" role="tooltip">',
'explanation': 'Fix any of the following:\n aria-label attribute does not exist or is empty\n aria-labelledby attribute does not exist, references elements that do not exist or references elements that are empty\n Element has no title attribute\n Element does not have text that is visible to screen readers',
'explanation': 'Fix any of the following:\n Element does not have text that is visible to screen readers\n aria-label attribute does not exist or is empty\n aria-labelledby attribute does not exist, references elements that do not exist or references elements that are empty\n Element has no title attribute',
'nodeLabel': 'div',
},
},
Expand Down Expand Up @@ -239,7 +239,7 @@ const expectations = [
'selector': 'body > section > div#aria-required-attr',
'path': '2,HTML,1,BODY,19,SECTION,0,DIV',
'snippet': '<div id="aria-required-attr" role="checkbox">',
'explanation': 'Fix any of the following:\n aria-label attribute does not exist or is empty\n aria-labelledby attribute does not exist, references elements that do not exist or references elements that are empty\n Element has no title attribute\n Element does not have text that is visible to screen readers',
'explanation': 'Fix any of the following:\n Element does not have text that is visible to screen readers\n aria-label attribute does not exist or is empty\n aria-labelledby attribute does not exist, references elements that do not exist or references elements that are empty\n Element has no title attribute',
'nodeLabel': 'div',
},
},
Expand Down Expand Up @@ -314,7 +314,7 @@ const expectations = [
'type': 'node',
'selector': 'body > section > button#button-name',
'snippet': '<button id="button-name">',
'explanation': 'Fix any of the following:\n Element does not have inner text that is visible to screen readers\n aria-label attribute does not exist or is empty\n aria-labelledby attribute does not exist, references elements that do not exist or references elements that are empty\n Element\'s default semantics were not overridden with role="none" or role="presentation"\n Element has no title attribute',
'explanation': 'Fix any of the following:\n Element does not have inner text that is visible to screen readers\n aria-label attribute does not exist or is empty\n aria-labelledby attribute does not exist, references elements that do not exist or references elements that are empty\n Element has no title attribute\n Element\'s default semantics were not overridden with role="none" or role="presentation"',
'nodeLabel': 'button',
},
},
Expand Down Expand Up @@ -456,7 +456,7 @@ const expectations = [
'type': 'node',
'selector': 'body > section > iframe#frame-title',
'snippet': '<iframe id="frame-title">',
'explanation': 'Fix any of the following:\n aria-label attribute does not exist or is empty\n aria-labelledby attribute does not exist, references elements that do not exist or references elements that are empty\n Element has no title attribute\n Element\'s default semantics were not overridden with role="none" or role="presentation"',
'explanation': 'Fix any of the following:\n Element has no title attribute\n aria-label attribute does not exist or is empty\n aria-labelledby attribute does not exist, references elements that do not exist or references elements that are empty\n Element\'s default semantics were not overridden with role="none" or role="presentation"',
'nodeLabel': 'iframe',
},
},
Expand Down
3 changes: 3 additions & 0 deletions lighthouse-core/gather/gatherers/accessibility.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@ async function runA11yChecks() {
'svg-img-alt': {enabled: false},
'audio-caption': {enabled: false},
'aria-treeitem-name': {enabled: true},
// https://github.com/dequelabs/axe-core/issues/2958
'nested-interactive': {enabled: false},
'frame-focusable-content': {enabled: false},
},
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ describe('ReportRenderer', () => {
global.Element = undefined;
});

it('renders without axe violations', (done) => {
it('renders without axe violations', () => {
const container = renderer._dom._document.createElement('main');
const output = renderer.renderReport(sampleResults, container);
renderer._dom._document.body.appendChild(container);
Expand All @@ -311,15 +311,18 @@ describe('ReportRenderer', () => {
'link-in-text-block': {enabled: false},
// Report has empty links prior to i18n-ing.
'link-name': {enabled: false},
// May not be a real issue. https://github.com/dequelabs/axe-core/issues/2958
'nested-interactive': {enabled: false},
},
};

axe.run(output, config, (error, {violations}) => {
assert.ifError(error);
assert.ok(violations.length === 0, JSON.stringify(violations, null, 1));
done();
return new Promise(resolve => {
axe.run(output, config, (error, {violations}) => {
expect(error).toBeNull();
expect(violations).toEqual([]);
resolve();
});
});

// Set timeout to 10s to give axe-core enough time to complete
// https://github.com/dequelabs/axe-core/tree/b573b1c1/doc/examples/jest_react#timeout-issues
}, /* timeout= */ 10 * 1000);
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@
"webtreemap-cdt": "^3.2.0"
},
"dependencies": {
"axe-core": "4.1.3",
"axe-core": "4.2.1",
"chrome-launcher": "^0.14.0",
"configstore": "^5.0.1",
"csp_evaluator": "^1.0.1",
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1370,10 +1370,10 @@ aws4@^1.8.0:
resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.8.0.tgz#f0e003d9ca9e7f59c7a508945d7b2ef9a04a542f"
integrity sha512-ReZxvNHIOv88FlT7rxcXIIC0fPt4KZqZbOlivyWtXLt8ESx84zd3kMC6iK5jVeS2qt+g7ftS7ye4fi06X5rtRQ==

axe-core@4.1.3:
version "4.1.3"
resolved "https://registry.yarnpkg.com/axe-core/-/axe-core-4.1.3.tgz#64a4c85509e0991f5168340edc4bedd1ceea6966"
integrity sha512-vwPpH4Aj4122EW38mxO/fxhGKtwWTMLDIJfZ1He0Edbtjcfna/R3YB67yVhezUMzqc3Jr3+Ii50KRntlENL4xQ==
axe-core@4.2.1:
version "4.2.1"
resolved "https://registry.yarnpkg.com/axe-core/-/axe-core-4.2.1.tgz#2e50bcf10ee5b819014f6e342e41e45096239e34"
integrity sha512-evY7DN8qSIbsW2H/TWQ1bX3sXN1d4MNb5Vb4n7BzPuCwRHdkZ1H2eNLuSh73EoQqkGKUtju2G2HCcjCfhvZIAA==

babel-jest@^26.6.3:
version "26.6.3"
Expand Down

0 comments on commit b31823e

Please sign in to comment.