Skip to content

Commit

Permalink
feat: deprecate autocomplete appropriate check (#2917)
Browse files Browse the repository at this point in the history
* feat: deprecate autocomplete appropriate check

* make autocomplete-appropriate a minor violation since it's deprecated

* remove deprecated autocomplete-appropriate check from autocomplete-valid rule

* impact should still be severe

* update tests

* remove act-mapping test that fails but shouldn't
  • Loading branch information
clottman committed Jun 3, 2021
1 parent 5ccc797 commit 1fe1487
Show file tree
Hide file tree
Showing 6 changed files with 3 additions and 37 deletions.
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 @@ -7,7 +7,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 @@ -150,10 +147,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);
});
});

0 comments on commit 1fe1487

Please sign in to comment.