Skip to content

Commit

Permalink
feat(empty-table-headers): rule is now best-practice and fails instea…
Browse files Browse the repository at this point in the history
…d of incompletes (#3427)

* Update empty-table-header.json

References #3404

* update tests

* ignore aira-practices pages that violate empty-table-header

* remove impact from rule

Co-authored-by: Steven Lambert <steven.lambert@deque.com>
  • Loading branch information
fstrr and straker authored Apr 12, 2022
1 parent 7e034be commit 0a4397d
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 9 deletions.
5 changes: 2 additions & 3 deletions lib/rules/empty-table-header.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
{
"id": "empty-table-header",
"selector": "th, [role=\"rowheader\"], [role=\"columnheader\"]",
"tags": ["wcag131", "cat.aria"],
"reviewOnFail": true,
"tags": ["cat.name-role-value", "best-practice"],
"metadata": {
"description": "Ensures table headers have discernible text",
"help": "Table header text must not be empty"
"help": "Table header text should not be empty"
},
"all": [],
"any": ["has-visible-text"],
Expand Down
7 changes: 5 additions & 2 deletions test/aria-practices/apg.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,11 @@ describe('aria-practices', function() {
'landmark-banner-is-top-level',
'landmark-contentinfo-is-top-level'
],
//https://github.com/w3c/aria-practices/issues/2199
'button/button_idl.html': ['aria-allowed-attr']
// https://github.com/w3c/aria-practices/issues/2199
'button/button_idl.html': ['aria-allowed-attr'],
// https://github.com/w3c/aria-practices/issues/2285
'checkbox/checkbox.html': ['empty-table-header'],
'dialog-modal/datepicker-dialog.html': ['empty-table-header']
};

// Not an actual content file
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,21 +26,21 @@

<table>
<tr>
<th id="incomplete1"></th>
<th id="fail1"></th>
</tr>
</table>

<table>
<tr>
<td id="incomplete2" role="rowheader">
<td id="fail2" role="rowheader">
<div style="display: none">Not Ok</div>
</td>
</tr>
</table>

<table>
<tr>
<td id="incomplete3" role="columnheader">
<td id="fail3" role="columnheader">
<div style="display: none">Not Ok</div>
</td>
</tr>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"description": "empty-table-header tests",
"rule": "empty-table-header",
"incomplete": [["#incomplete1"], ["#incomplete2"], ["#incomplete3"]],
"violations": [["#fail1"], ["#fail2"], ["#fail3"]],
"passes": [["#pass1"], ["#pass2"], ["#pass3"]]
}

0 comments on commit 0a4397d

Please sign in to comment.