-
Notifications
You must be signed in to change notification settings - Fork 83
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1775 from IBMa/dev-761
fixrule(`input_label_exists`) fix issue related to button element with a label
- Loading branch information
Showing
3 changed files
with
88 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
75 changes: 75 additions & 0 deletions
75
...-engine/test/v2/checker/accessibility/rules/input_label_exists_ruleunit/button_label.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
<!DOCTYPE html> | ||
<html lang="en-US"> | ||
<head> | ||
<title>Sandbox</title> | ||
<meta charset="UTF-8" /> | ||
</head> | ||
|
||
<body> | ||
<main> | ||
<h1>Test page</h1> | ||
<div class="cds--toggle"> | ||
<button | ||
id="toggle-1" | ||
class="cds--toggle__button" | ||
role="switch" | ||
type="button" | ||
aria-checked="true" | ||
></button> | ||
<label for="toggle-1" class="cds--toggle__label"> | ||
<span class="cds--toggle__label-text">Toggle element label 1</span> | ||
</label> | ||
</div> | ||
<div> | ||
<label for="toggle-2" class="cds--toggle__label"> | ||
<button | ||
id="toggle-2" | ||
class="cds--toggle__button" | ||
type="button" | ||
></button> | ||
<span class="cds--toggle__label-text">Toggle element label 2</span> | ||
</label> | ||
</div> | ||
</main> | ||
|
||
<script> | ||
UnitTest = { | ||
ruleIds: ["input_label_exists"], | ||
results: [ | ||
{ | ||
"ruleId": "input_label_exists", | ||
"value": [ | ||
"INFORMATION", | ||
"PASS" | ||
], | ||
"path": { | ||
"dom": "/html[1]/body[1]/main[1]/div[1]/button[1]", | ||
"aria": "/document[1]/main[1]/switch[1]" | ||
}, | ||
"reasonId": "Pass_0", | ||
"message": "Rule Passed", | ||
"messageArgs": [], | ||
"apiArgs": [], | ||
"category": "Accessibility" | ||
}, | ||
{ | ||
"ruleId": "input_label_exists", | ||
"value": [ | ||
"INFORMATION", | ||
"PASS" | ||
], | ||
"path": { | ||
"dom": "/html[1]/body[1]/main[1]/div[2]/label[1]/button[1]", | ||
"aria": "/document[1]/main[1]/button[1]" | ||
}, | ||
"reasonId": "Pass_0", | ||
"message": "Rule Passed", | ||
"messageArgs": [], | ||
"apiArgs": [], | ||
"category": "Accessibility" | ||
} | ||
] | ||
}; | ||
</script> | ||
</body> | ||
</html> |