Skip to content

Commit

Permalink
Add tests for explicit "form" roles
Browse files Browse the repository at this point in the history
  • Loading branch information
matatk committed Jun 2, 2019
1 parent 1fbae26 commit 9fc2bf4
Show file tree
Hide file tree
Showing 5 changed files with 55 additions and 0 deletions.
19 changes: 19 additions & 0 deletions combined/expectations.json
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,19 @@
}
]
},
"form-unlabelled-with-explicit-role": {
"meta": {
"name": "Form with no label, but an explicit role, is recognised"
},
"expected": [
{
"type": "landmark",
"role": "form",
"label": "null",
"selector": "body > div"
}
]
},
"header-containing-nav-nav-search": {
"meta": {
"name": "Header with nested landmarks, and others are recognised"
Expand Down Expand Up @@ -585,6 +598,12 @@
"label": null,
"selector": "#complementary",
"contains": [
{
"type": "landmark",
"role": "form",
"label": null,
"selector": "#form"
},
{
"type": "landmark",
"role": "search",
Expand Down
5 changes: 5 additions & 0 deletions combined/fixtures.html
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,11 @@ <h1 id="form-heading">Report a Fault</h1>
<p>A form with a visible name for all folk!</p>
</form>
</div>
<div data-test-id="form-unlabelled-with-explicit-role">
<div role="form">
<p>The form with no name, but an explicit role.</p>
</div>
</div>
<div data-test-id="header-containing-nav-nav-search">
<header>
Page Header
Expand Down
13 changes: 13 additions & 0 deletions expectations/form-unlabelled-with-explicit-role.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"meta": {
"name": "Form with no label, but an explicit role, is recognised"
},
"expected": [
{
"type": "landmark",
"role": "form",
"label": "null",
"selector": "body > div"
}
]
}
6 changes: 6 additions & 0 deletions expectations/roles-land.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,12 @@
"label": null,
"selector": "#complementary",
"contains": [
{
"type": "landmark",
"role": "form",
"label": null,
"selector": "#form"
},
{
"type": "landmark",
"role": "search",
Expand Down
12 changes: 12 additions & 0 deletions fixtures/form-unlabelled-with-explicit-role.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title></title>
</head>
<body>
<div role="form">
<p>The form with no name, but an explicit role.</p>
</div>
</body>
</html>

0 comments on commit 9fc2bf4

Please sign in to comment.