Skip to content

Commit

Permalink
update the test case and result #842
Browse files Browse the repository at this point in the history
  • Loading branch information
shunguoy committed Jun 18, 2024
1 parent 3ba46ae commit eef2082
Show file tree
Hide file tree
Showing 2 changed files with 133 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
limitations under the License.
*****************************************************************************/

import { Rule, RuleResult, RuleFail, RuleContext, RulePotential, RuleManual, RulePass, RuleContextHierarchy } from "../api/IRule";
import { Rule, RuleResult, RuleFail, RuleContext, RulePass, RuleContextHierarchy } from "../api/IRule";
import { eRulePolicy, eToolkitLevel } from "../api/IRule";
import { FragmentUtil } from "../../v2/checker/accessibility/util/fragment";
import { VisUtil } from "../../v2/dom/VisUtil";
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 5 Transitional//EN" "http://www.w3.org/TR/html5/loose.dtd">

<!--
/******************************************************************************
Copyright:: 2020- IBM, Inc
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*****************************************************************************/
-->

<html lang="en">

<head>
<title>RPT Test Suite</title>
</head>

<body>

<a href="#navskip">skip to main content</a>





<!-- ################################################################### -->


<h3>Input type Tests</h3>

<!-- items at risk -->

<form action="..." method="post">
<label for="f10">fs 2</label>
<label for="l10">lg 2</label>
<fieldset id="f10">
<legend id="l10">Legend text:datetime </legend>
<label for="datetime1">DateTime field 1</label>
<input type="datetime" name="datetime1" id="datetime1" value="0" title="date and time">

<label for="datetime2">DateTime field 2</label>
<input type="datetime-local" name="datetime2" id="datetime2" value="0" title="date and time">
</fieldset>
</form>

<a name="navskip">End</a>

<script>
UnitTest = {
ruleIds: ["label_ref_valid"],
results: [
{
"ruleId": "label_ref_valid",
"value": [
"INFORMATION",
"PASS"
],
"path": {
"dom": "/html[1]/body[1]/form[1]/label[1]",
"aria": "/document[1]/form[1]"
},
"reasonId": "pass",
"message": "The 'for' attribute for a label referencea a unique non-empty 'id' attribute of an <input> element",
"messageArgs": [],
"apiArgs": [],
"category": "Accessibility"
},
{
"ruleId": "label_ref_valid",
"value": [
"INFORMATION",
"PASS"
],
"path": {
"dom": "/html[1]/body[1]/form[1]/label[2]",
"aria": "/document[1]/form[1]"
},
"reasonId": "pass",
"message": "The 'for' attribute for a label referencea a unique non-empty 'id' attribute of an <input> element",
"messageArgs": [],
"apiArgs": [],
"category": "Accessibility"
},
{
"ruleId": "label_ref_valid",
"value": [
"INFORMATION",
"FAIL"
],
"path": {
"dom": "/html[1]/body[1]/form[1]/fieldset[1]/label[1]",
"aria": "/document[1]/form[1]/group[1]"
},
"reasonId": "fail_invalid",
"message": "The value \"datetime1\" of the 'for' attribute is not the 'id' of a valid <input> element",
"messageArgs": [
"datetime1"
],
"apiArgs": [],
"category": "Accessibility"
},
{
"ruleId": "label_ref_valid",
"value": [
"INFORMATION",
"PASS"
],
"path": {
"dom": "/html[1]/body[1]/form[1]/fieldset[1]/label[2]",
"aria": "/document[1]/form[1]/group[1]"
},
"reasonId": "pass",
"message": "The 'for' attribute for a label referencea a unique non-empty 'id' attribute of an <input> element",
"messageArgs": [],
"apiArgs": [],
"category": "Accessibility"
}
]
};
</script>
</body>

</html>

0 comments on commit eef2082

Please sign in to comment.