Skip to content

Commit

Permalink
core(a11y): re-enable target-size hidden audit (#15888)
Browse files Browse the repository at this point in the history
  • Loading branch information
connorjclark authored Apr 1, 2024
1 parent 79b8907 commit 3f4b61d
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 32 deletions.
55 changes: 27 additions & 28 deletions cli/test/smokehouse/test-definitions/a11y.js
Original file line number Diff line number Diff line change
Expand Up @@ -930,34 +930,33 @@ const expectations = {
],
},
},
// TODO: https://github.com/GoogleChrome/lighthouse/issues/15824
// 'target-size': {
// score: 1,
// details: {
// items: [
// {
// node: {
// 'type': 'node',
// 'selector': 'body > section > button#target-size-1',
// 'snippet': '<button id="target-size-1">',
// // Exact target size can vary depending on the device.
// 'explanation': /^Fix any of the following:\n {2}Target has insufficient size \([0-9.]+px by [0-9.]+px, should be at least 24px by 24px\)\n {2}Target has insufficient space to its closest neighbors. Safe clickable space has a diameter of [0-9.]+px instead of at least 24px\.$/,
// 'nodeLabel': '+',
// },
// },
// {
// node: {
// 'type': 'node',
// 'selector': 'body > section > span#target-size-2',
// 'snippet': '<span role="button" tabindex="0" id="target-size-2">',
// // Exact target size can vary depending on the device.
// 'explanation': /^Fix any of the following:\n {2}Target has insufficient size \([0-9.]+px by [0-9.]+px, should be at least 24px by 24px\)\n {2}Target has insufficient space to its closest neighbors. Safe clickable space has a diameter of [0-9.]+px instead of at least 24px\.$/,
// 'nodeLabel': 'o',
// },
// },
// ],
// },
// },
'target-size': {
score: 1,
details: {
items: [
{
node: {
'type': 'node',
'selector': 'body > section > button#target-size-1',
'snippet': '<button id="target-size-1">',
// Exact target size can vary depending on the device.
'explanation': /^Fix any of the following:\n {2}Target has insufficient size \([0-9.]+px by [0-9.]+px, should be at least 24px by 24px\)\n {2}Target has insufficient space to its closest neighbors. Safe clickable space has a diameter of [0-9.]+px instead of at least 24px\.$/,
'nodeLabel': '+',
},
},
{
node: {
'type': 'node',
'selector': 'body > section > span#target-size-2',
'snippet': '<span role="button" tabindex="0" id="target-size-2">',
// Exact target size can vary depending on the device.
'explanation': /^Fix any of the following:\n {2}Target has insufficient size \([0-9.]+px by [0-9.]+px, should be at least 24px by 24px\)\n {2}Target has insufficient space to its closest neighbors. Safe clickable space has a diameter of [0-9.]+px instead of at least 24px\.$/,
'nodeLabel': 'o',
},
},
],
},
},
'td-has-header': {
score: 0,
details: {
Expand Down
3 changes: 1 addition & 2 deletions core/gather/gatherers/accessibility.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,7 @@ async function runA11yChecks() {
'tabindex': {enabled: true},
'table-duplicate-name': {enabled: true},
'table-fake-caption': {enabled: true},
// TODO: https://github.com/GoogleChrome/lighthouse/issues/15824
// 'target-size': {enabled: true},
'target-size': {enabled: true},
'td-has-header': {enabled: true},
},
});
Expand Down
2 changes: 0 additions & 2 deletions core/test/gather/gatherers/accessibility-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,6 @@ describe('a11y audits + aXe', () => {
// Note: audit ids match their filenames, thx to the getAuditList test in runner-test.js
const filenames = fs.readdirSync(`${LH_ROOT}/core/audits/accessibility/`)
.map(f => f.replace('.js', ''))
// TODO: https://github.com/GoogleChrome/lighthouse/issues/15824
.filter(f => f !== 'target-size')
.filter(f => f !== 'axe-audit' && f !== 'manual');

// 4. Compare. (Received from aXe, Expected is LH audits)
Expand Down

0 comments on commit 3f4b61d

Please sign in to comment.