Skip to content

Commit

Permalink
Add tests for aria-empty-table-header rule
Browse files Browse the repository at this point in the history
  • Loading branch information
jlin95 committed Feb 21, 2021
1 parent bb7c671 commit 7fd95fd
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 9 deletions.
5 changes: 3 additions & 2 deletions lib/rules/aria-empty-table-header.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
{
"id": "aria-empty-table-header",
"selector": "th, [role=\"rowheader\"], [role=\"columnheader\"]",
"matches": "heading-matches",
"tags": ["wcag131"],
"metadata": {
"description": "Ensures table headers have discernible text",
"help": "Table header text must not be empty"
},
"all": ["has-accessible-text"],
"any": [],
"all": [],
"any": ["has-accessible-text"],
"none": []
}
Original file line number Diff line number Diff line change
@@ -1 +1,21 @@
<!-- HTML Snippets-->
<!DOCTYPE html>
<html lang="en">
<head>
<title>empty-table-header test</title>
<meta charset="utf8" />
<script src="/axe.js"></script>
</head>

<body>
<th id="pass1">Ok</th>
<td id="pass2" role="rowheader">rowheader with name</td>
<td id="pass3" role="columnheader">columnheader with name</td>
<th id="fail1"></th>
<td id="fail2" role="rowheader">
<div style="display: none">Not Ok</div>
</td>
<td id="fail3" role="columnheader">
<div style="display: none">Not Ok</div>
</td>
</body>
</html>
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"description": "aria-empty-table-header tests",
"rule": "aria-empty-table-header",
"violations": [],
"passes": []
"violations": [["fail1"], ["fail2"], ["fail3"]],
"passes": [["#pass1"], ["#pass2"], ["#pass3"]]
}
4 changes: 0 additions & 4 deletions test/rule-matches/aria-empty-table-header-matches.js

This file was deleted.

0 comments on commit 7fd95fd

Please sign in to comment.