This repository has been archived by the owner on Sep 24, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added test for technique H65, issue #64.
- Loading branch information
Kevin Miller
committed
Jan 5, 2014
1 parent
426fe50
commit 16baa0a
Showing
5 changed files
with
108 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
quail.inputWithoutLabelHasTitle = function() { | ||
quail.html.find('input, select, textarea').each(function() { | ||
if(!$(this).parent('label').length && | ||
!quail.html.find('label[for=' + $(this).attr('id') + ']').length && | ||
(!$(this).attr('title') || !quail.containsReadableText($(this).attr('title')))) { | ||
quail.testFails('inputWithoutLabelHasTitle', $(this)); | ||
} | ||
}); | ||
}; |
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
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,35 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!doctype html> | ||
<html> | ||
|
||
<head> | ||
<title>inputWithoutLabelHasTitle-fail</title> | ||
<link rel="stylesheet" href="../../../lib/qunit/qunit/qunit.css" media="screen"> | ||
</head> | ||
|
||
<body> | ||
<div id="quail-scope"> | ||
<form> | ||
<label for="select">Select your favorite pet</label> | ||
<select id="select"> | ||
<option>Cat</option> | ||
<option>Dog</option> | ||
<option>Fish</option> | ||
</select> | ||
<input type="text"></input> | ||
<button type="submit">Search</button> | ||
</form> | ||
</div> | ||
<script id="qunit-jquery" src="../../../lib/jquery/jquery.js"></script> | ||
<script id="qunit-quail" src="../../../dist/quail.jquery.js"></script> | ||
<script id="qunit-composite" src="../../composite.js"></script> | ||
<script id="qunit-qunit" src="../../../lib/qunit/qunit/qunit.js"></script> | ||
<script id="qunit-script"> | ||
test('inputWithoutLabelHasTitle', function() { | ||
quailTest.runTest( 'inputWithoutLabelHasTitle' ); | ||
equal(true, quailTest.confirmIsTag('input'), 'Input throws an error'); | ||
}); | ||
</script> | ||
</body> | ||
|
||
</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,35 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!doctype html> | ||
<html> | ||
|
||
<head> | ||
<title>inputWithoutLabelHasTitle-pass</title> | ||
<link rel="stylesheet" href="../../../lib/qunit/qunit/qunit.css" media="screen"> | ||
</head> | ||
|
||
<body> | ||
<div id="quail-scope"> | ||
<form> | ||
<label for="select">Select your favorite pet</label> | ||
<select id="select"> | ||
<option>Cat</option> | ||
<option>Dog</option> | ||
<option>Fish</option> | ||
</select> | ||
<input type="text" title="Search keywords"></input> | ||
<button type="submit">Search</button> | ||
</form> | ||
</div> | ||
<script id="qunit-jquery" src="../../../lib/jquery/jquery.js"></script> | ||
<script id="qunit-quail" src="../../../dist/quail.jquery.js"></script> | ||
<script id="qunit-composite" src="../../composite.js"></script> | ||
<script id="qunit-qunit" src="../../../lib/qunit/qunit/qunit.js"></script> | ||
<script id="qunit-script"> | ||
test('inputWithoutLabelHasTitle', function() { | ||
quailTest.runTest( 'inputWithoutLabelHasTitle' ); | ||
equal(true, quailTest.confirmIsEmpty(), 'No errors were found'); | ||
}); | ||
</script> | ||
</body> | ||
|
||
</html> |