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

feat: deprecate autocomplete appropriate check #2917

Merged
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
1 change: 1 addition & 0 deletions lib/checks/forms/autocomplete-appropriate.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"id": "autocomplete-appropriate",
"evaluate": "autocomplete-appropriate-evaluate",
"deprecated": true,
"metadata": {
"impact": "serious",
"messages": {
Expand Down
2 changes: 1 addition & 1 deletion lib/rules/autocomplete-valid.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"description": "Ensure the autocomplete attribute is correct and suitable for the form field",
"help": "autocomplete attribute must be used correctly"
},
"all": ["autocomplete-valid", "autocomplete-appropriate"],
"all": ["autocomplete-valid"],
"any": [],
"none": []
}
5 changes: 0 additions & 5 deletions test/act-mapping/autocomplete-valid.json

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,6 @@
<!-- comma seperated rather than space separated list -->
<input autocomplete="work,email" id="fail4" />

<!-- inappropriate field type -->
<input type="number" autocomplete="email" id="fail5" />

<!-- Incorrect element -->
<button autocomplete="username" id="inapplicable1"></button>

Expand Down Expand Up @@ -149,10 +146,6 @@

<input autocomplete="one-time-code" id="pass77" />

<input autocomplete="street-address" id="fail6" type="file" />
<input autocomplete="bday-month" type="month" id="fail7" />
<input type="NUMBER" autocomplete="email" id="fail8" />

<input autocomplete="cc-number" type="tel" id="pass78" />
<input autocomplete="cc-exp" type="tel" id="pass79" />
<input autocomplete="cc-exp-month" type="tel" id="pass80" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,7 @@
{
"description": "autocomplete-valid tests",
"rule": "autocomplete-valid",
"violations": [
["#fail1"],
["#fail2"],
["#fail3"],
["#fail4"],
["#fail5"],
["#fail6"],
["#fail7"],
["#fail8"]
],
"violations": [["#fail1"], ["#fail2"], ["#fail3"], ["#fail4"]],
"passes": [
["#pass1"],
["#pass2"],
Expand Down
14 changes: 0 additions & 14 deletions test/integration/virtual-rules/autocomplete-valid.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,18 +40,4 @@ describe('autocomplete-valid virtual-rule', function() {
assert.lengthOf(results.violations, 1);
assert.lengthOf(results.incomplete, 0);
});

it('should fail when autocomplete is incorrectly used', function() {
var results = axe.runVirtualRule('autocomplete-valid', {
nodeName: 'input',
attributes: {
type: 'color',
autocomplete: 'email'
}
});

assert.lengthOf(results.passes, 0);
assert.lengthOf(results.violations, 1);
assert.lengthOf(results.incomplete, 0);
});
});