Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

core(a11y): re-enable target-size hidden audit #15888

Merged
merged 5 commits into from
Apr 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading