Skip to content
This repository has been archived by the owner on Sep 24, 2019. It is now read-only.

Commit

Permalink
Merge pull request #108 from kevee/hotfix
Browse files Browse the repository at this point in the history
Hotfix - add test results per issue #99
  • Loading branch information
Kevin Miller committed Jan 12, 2014
2 parents 37b8d80 + e0c5fba commit 4fc83b9
Show file tree
Hide file tree
Showing 40 changed files with 61 additions and 58 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,4 @@ Credits
Legal
-----

QUAIL is covered under the MIT License, and is copyright (c) 2013 by Kevin Miller. Current license is at http://quailjs.org/license.
QUAIL is covered under the MIT License, and is copyright (c) 2013 by Kevin Miller. Current license is at http://quailjs.org/license.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "quail",
"version": "2.1.0",
"main": "dist/quail.jquery.js",
"main": "dist/*",
"ignore": [
".jshintrc",
"**/*.txt"
Expand Down
8 changes: 4 additions & 4 deletions dist/quail.jquery.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,7 @@ var quail = {
var results = {totals : {severe : 0, moderate : 0, suggestion : 0 },
results : quail.accessibilityResults };
$.each(results.results, function(testName, result) {
results.totals[quail.testabilityTranslation[quail.accessibilityTests[testName].testability]] += result.length;
});
results.totals[quail.testabilityTranslation[quail.accessibilityTests[testName].testability]] += result.elements.length; });
quail.options.complete(results);
}
},
Expand Down Expand Up @@ -129,14 +128,15 @@ var quail = {
}
}

quail.accessibilityResults[testName].push($element);
quail.accessibilityResults[testName].elements.push($element);
if(typeof quail.options.testFailed !== 'undefined') {
var testability = (typeof quail.accessibilityTests[testName].testability !== 'undefined') ?
quail.accessibilityTests[testName].testability :
'unknown';
var severity =
quail.options.testFailed({element : $element,
testName : testName,
test : quail.accessibilityTests[testName],
testability : testability,
severity : quail.testabilityTranslation[testability],
options : options
Expand All @@ -157,7 +157,7 @@ var quail = {
}
var testType = quail.accessibilityTests[testName].type;
if(typeof quail.accessibilityResults[testName] === 'undefined') {
quail.accessibilityResults[testName] = [ ];
quail.accessibilityResults[testName] = { test : quail.accessibilityTests[testName], elements : [ ] };
}
if(testType === 'selector') {
quail.html.find(quail.accessibilityTests[testName].selector).each(function() {
Expand Down
2 changes: 1 addition & 1 deletion dist/quail.jquery.min.js

Large diffs are not rendered by default.

9 changes: 6 additions & 3 deletions docs/tests/imgAltNotPlaceHolder.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,13 @@ Images should not have a simple placeholder text as an "alt" attribute
Any image that is not used decorativey or which is purely for layout purposes cannot have an "alt" attribute that consists solely of placeholders. Placeholders include:

* nbsp
*  
* spacer
* image
* img
* photo


<ul><li>nbsp</li><li>&amp;nbsp;</li><li>spacer</li><li>image</li><li>img</li><li>photo</li></ul>Example
-------
Wrong
-----

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "quail",
"description": "A javascript content accessibility checker.",
"homepage": "http://quailjs.org",
"version": "2.1.0",
"version": "2.1.1",
"engines": {
"node": ">= 0.10.20"
},
Expand Down
2 changes: 1 addition & 1 deletion quail.jquery.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"homepage": "http://quailjs.org",
"docs": "http://quail.readthedocs.org/en/latest/",
"demo": "http://quailjs.org/examples/",
"version": "2.1.0",
"version": "2.1.1",
"author": {
"name": "Kevin Miller",
"email": "[email protected]",
Expand Down
2 changes: 1 addition & 1 deletion quail.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "quail",
"title": "Quail",
"description": "QUAIL Accessibility Information Library.",
"version": "2.1.0",
"version": "2.1.1",
"homepage": "https://github.com/kevee/quail",
"author": {
"name": "Kevin Miller",
Expand Down
8 changes: 4 additions & 4 deletions src/js/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,7 @@ var quail = {
var results = {totals : {severe : 0, moderate : 0, suggestion : 0 },
results : quail.accessibilityResults };
$.each(results.results, function(testName, result) {
results.totals[quail.testabilityTranslation[quail.accessibilityTests[testName].testability]] += result.length;
});
results.totals[quail.testabilityTranslation[quail.accessibilityTests[testName].testability]] += result.elements.length; });
quail.options.complete(results);
}
},
Expand Down Expand Up @@ -127,14 +126,15 @@ var quail = {
}
}

quail.accessibilityResults[testName].push($element);
quail.accessibilityResults[testName].elements.push($element);
if(typeof quail.options.testFailed !== 'undefined') {
var testability = (typeof quail.accessibilityTests[testName].testability !== 'undefined') ?
quail.accessibilityTests[testName].testability :
'unknown';
var severity =
quail.options.testFailed({element : $element,
testName : testName,
test : quail.accessibilityTests[testName],
testability : testability,
severity : quail.testabilityTranslation[testability],
options : options
Expand All @@ -155,7 +155,7 @@ var quail = {
}
var testType = quail.accessibilityTests[testName].type;
if(typeof quail.accessibilityResults[testName] === 'undefined') {
quail.accessibilityResults[testName] = [ ];
quail.accessibilityResults[testName] = { test : quail.accessibilityTests[testName], elements : [ ] };
}
if(testType === 'selector') {
quail.html.find(quail.accessibilityTests[testName].selector).each(function() {
Expand Down
14 changes: 7 additions & 7 deletions test/composite.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,36 +27,36 @@ var quailTest = {
reset : true,
accessibilityTests : accessibilityTests,
complete : function(results) {
$.each(results.results[testName], function(index, item) {
$.each(results.results[testName].elements, function(index, item) {
if(typeof item === 'undefined' ||
(item && item.attr('id') && item.attr('id').indexOf('qunit-') !== -1) ||
item.parents('#qunit-wrapper').length) {
results.results[testName].splice(index, 1);
results.results[testName].elements.splice(index, 1);
}
});
quailTest.results = results.results;
}});
},

confirmIsEmpty : function() {
$.each(quailTest.results[quailTest.testName], function(index, item) {
$.each(quailTest.results[quailTest.testName].elements, function(index, item) {
if(typeof item === 'undefined' ||
(item && item.attr('id') && item.attr('id').indexOf('qunit-') !== -1) ||
item.parents('#qunit-wrapper').length) {
quailTest.results[quailTest.testName].splice(index, 1);
quailTest.results[quailTest.testName].elements.splice(index, 1);
}
});
if(quailTest.results[quailTest.testName].length) {
if(quailTest.results[quailTest.testName].elements.length) {
return false;
}
return true;
},

confirmIsTag : function(tag) {
if(typeof quailTest.results[quailTest.testName][0] === 'undefined') {
if(typeof quailTest.results[quailTest.testName].elements[0] === 'undefined') {
return false;
}
return quailTest.results[quailTest.testName][0].is(tag);
return quailTest.results[quailTest.testName].elements[0].is(tag);
},

insertElements : function(callback) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<script id="qunit-script">
test('aLinksToMultiMediaRequireTranscript', function() {
quailTest.runTest( 'aLinksToMultiMediaRequireTranscript', '20-3.html');
equal(quailTest.results[quailTest.testName][0].attr('href'), 'movie.mpg', 'Item attribute check');
equal(quailTest.results[quailTest.testName].elements[0].attr('href'), 'movie.mpg', 'Item attribute check');
});
</script>
</body>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<script id="qunit-script">
test('aLinksToMultiMediaRequireTranscript', function() {
quailTest.runTest( 'aLinksToMultiMediaRequireTranscript', '20-4.html');
equal(quailTest.results[quailTest.testName][0].attr('href'), 'movie.mov', 'Item attribute check');
equal(quailTest.results[quailTest.testName].elements[0].attr('href'), 'movie.mov', 'Item attribute check');
});
</script>
</body>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<script id="qunit-script">
test('aLinksToMultiMediaRequireTranscript', function() {
quailTest.runTest( 'aLinksToMultiMediaRequireTranscript', '20-5.html');
equal(quailTest.results[quailTest.testName][0].attr('href'), 'movie.ram', 'Item attribute check');
equal(quailTest.results[quailTest.testName].elements[0].attr('href'), 'movie.ram', 'Item attribute check');
});
</script>
</body>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<script id="qunit-script">
test('aLinksToMultiMediaRequireTranscript', function() {
quailTest.runTest( 'aLinksToMultiMediaRequireTranscript', '20-6.html');
equal(quailTest.results[quailTest.testName][0].attr('href'), 'movie.aif', 'Item attribute check');
equal(quailTest.results[quailTest.testName].elements[0].attr('href'), 'movie.aif', 'Item attribute check');
});
</script>
</body>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<script id="qunit-script">
test('aLinksToMultiMediaRequireTranscript', function() {
quailTest.runTest( 'aLinksToMultiMediaRequireTranscript', '20-1.html');
equal(quailTest.results[quailTest.testName][0].attr('href'), 'movie.wmv', 'Item attribute check');
equal(quailTest.results[quailTest.testName].elements[0].attr('href'), 'movie.wmv', 'Item attribute check');
});
</script>
</body>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<script id="qunit-script">
test('aLinksToSoundFilesNeedTranscripts', function() {
quailTest.runTest( 'aLinksToSoundFilesNeedTranscripts', '17-1.html');
equal(quailTest.results[quailTest.testName][0].attr('href'), 'carol-talking.wav', 'Item attribute check');
equal(quailTest.results[quailTest.testName].elements[0].attr('href'), 'carol-talking.wav', 'Item attribute check');
});
</script>
</body>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
<script id="qunit-script">
test('cssDocumentMakesSenseStyleTurnedOff', function() {
quailTest.runTest( 'cssDocumentMakesSenseStyleTurnedOff', '97-2.html');
$.each(quailTest.results['cssDocumentMakesSenseStyleTurnedOff'], function(index, item) {
$.each(quailTest.results['cssDocumentMakesSenseStyleTurnedOff'].elements, function(index, item) {
if(item.is('body')) {
quailTest.results['cssDocumentMakesSenseStyleTurnedOff'].splice(index, 1);
quailTest.results['cssDocumentMakesSenseStyleTurnedOff'].elements.splice(index, 1);
}
});
equal(true, quailTest.confirmIsEmpty(), 'Results are empty');
Expand Down
2 changes: 1 addition & 1 deletion test/testfiles/common/documentAbbrIsUsed-fail.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
test('documentAbbrIsUsed', function() {
quailTest.runTest( 'documentAbbrIsUsed', '98-1.html');
var pass = false;
$.each(quailTest.results.documentAbbrIsUsed, function(index, abbr) {
$.each(quailTest.results.documentAbbrIsUsed.elements, function(index, abbr) {
if(abbr.hasClass('fail')) {
pass = true;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
test('documentAcronymsHaveElement', function() {
quailTest.runTest( 'documentAcronymsHaveElement', '99-1.html');
var pass = false;
$.each(quailTest.results.documentAcronymsHaveElement, function(index, abbr) {
$.each(quailTest.results.documentAcronymsHaveElement.elements, function(index, abbr) {
if(abbr.hasClass('fail')) {
pass = true;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<script id="qunit-script">
test('imgAltEmptyForDecorativeImages', function() {
quailTest.runTest( 'imgAltEmptyForDecorativeImages', '16-2.html');
equal(quailTest.results[quailTest.testName][0].attr('src'), 'resources/10pttab.gif', 'Item attribute check');
equal(quailTest.results[quailTest.testName].elements[0].attr('src'), 'resources/10pttab.gif', 'Item attribute check');
});
</script>
</body>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<script id="qunit-script">
test('imgAltEmptyForDecorativeImages', function() {
quailTest.runTest( 'imgAltEmptyForDecorativeImages', '16-3.html');
equal(quailTest.results[quailTest.testName][0].attr('src'), 'resources/star.gif', 'Item attribute check');
equal(quailTest.results[quailTest.testName].elements[0].attr('src'), 'resources/star.gif', 'Item attribute check');
});
</script>
</body>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<script id="qunit-script">
test('imgAltEmptyForDecorativeImages', function() {
quailTest.runTest( 'imgAltEmptyForDecorativeImages', '16-4.html');
equal(quailTest.results[quailTest.testName][0].attr('src'), 'resources/star.gif', 'Item attribute check');
equal(quailTest.results[quailTest.testName].elements[0].attr('src'), 'resources/star.gif', 'Item attribute check');
});
</script>
</body>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<script>
test('imgAltEmptyForDecorativeImages', function() {
quailTest.runTest( 'imgAltEmptyForDecorativeImages', '16-1.html');
equal(quailTest.results[quailTest.testName][0].attr('src'), 'resources/10pttab.gif', 'Item attribute check');
equal(quailTest.results[quailTest.testName].elements[0].attr('src'), 'resources/10pttab.gif', 'Item attribute check');
});
</script>
</body>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<script id="qunit-script">
test('imgAltIdentifiesLinkDestination', function() {
quailTest.runTest( 'imgAltIdentifiesLinkDestination', '15-2.html');
equal(quailTest.results[quailTest.testName][0].attr('src'), 'resources/topo.gif', 'Item attribute check');
equal(quailTest.results[quailTest.testName].elements[0].attr('src'), 'resources/topo.gif', 'Item attribute check');
});
</script>
</body>
Expand Down
2 changes: 1 addition & 1 deletion test/testfiles/common/imgAltIsSameInText-fail.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<script id="qunit-script">
test('imgAltIsSameInText', function() {
quailTest.runTest( 'imgAltIsSameInText', '11-1.html');
equal(quailTest.results[quailTest.testName][0].attr('alt'), 'logo', 'Item attribute check');
equal(quailTest.results[quailTest.testName].elements[0].attr('alt'), 'logo', 'Item attribute check');
});
</script>
</body>
Expand Down
2 changes: 1 addition & 1 deletion test/testfiles/common/imgAltIsSameInText-pass.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<script id="qunit-script">
test('imgAltIsSameInText', function() {
quailTest.runTest( 'imgAltIsSameInText', '11-2.html');
equal(quailTest.results[quailTest.testName][0].attr('alt'), 'W3C Working Draft logo', 'Item attribute check');
equal(quailTest.results[quailTest.testName].elements[0].attr('alt'), 'W3C Working Draft logo', 'Item attribute check');
});
</script>
</body>
Expand Down
2 changes: 1 addition & 1 deletion test/testfiles/common/imgHasLongDesc-fail-2.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<script id="qunit-script">
test('imgHasLongDesc', function() {
quailTest.runTest( 'imgHasLongDesc', '8-3.html');
equal(quailTest.results[quailTest.testName][0].attr('src'), 'resources/chart.gif', 'Image is chart.gif');
equal(quailTest.results[quailTest.testName].elements[0].attr('src'), 'resources/chart.gif', 'Image is chart.gif');
});
</script>
</body>
Expand Down
2 changes: 1 addition & 1 deletion test/testfiles/common/imgHasLongDesc-fail.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<script id="qunit-script">
test('imgHasLongDesc', function() {
quailTest.runTest( 'imgHasLongDesc', '8-1.html');
equal(quailTest.results[quailTest.testName][0].attr('src'), 'resources/chart.gif', 'Image is chart.gif');
equal(quailTest.results[quailTest.testName].elements[0].attr('src'), 'resources/chart.gif', 'Image is chart.gif');
});
</script>
</body>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
<script id="qunit-script">
test('imgMapAreasHaveDuplicateLink', function() {
quailTest.runTest( 'imgMapAreasHaveDuplicateLink', '13-3.html');
equal(quailTest.results[quailTest.testName][0].attr('src'), 'resources/navigation.gif', 'Item attribute check');
equal(quailTest.results[quailTest.testName].elements[0].attr('src'), 'resources/navigation.gif', 'Item attribute check');
});
</script>
</body>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
<script id="qunit-script">
test('imgMapAreasHaveDuplicateLink', function() {
quailTest.runTest( 'imgMapAreasHaveDuplicateLink', '13-1.html');
equal(quailTest.results[quailTest.testName][0].attr('src'), 'resources/navigation.gif', 'Item attribute check');
equal(quailTest.results[quailTest.testName].elements[0].attr('src'), 'resources/navigation.gif', 'Item attribute check');
});
</script>
</body>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ <h1>Clayton's Class</h1>
<script id="qunit-script">
test('imgNotReferredToByColorAlone', function() {
quailTest.runTest( 'imgNotReferredToByColorAlone', '14-2.html');
equal(quailTest.results[quailTest.testName][0].attr('src'), 'resources/kids.jpg', 'Item attribute check');
equal(quailTest.results[quailTest.testName].elements[0].attr('src'), 'resources/kids.jpg', 'Item attribute check');
});
</script>
</body>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ <h1>Clayton's Class</h1>
<script id="qunit-script">
test('imgNotReferredToByColorAlone', function() {
quailTest.runTest( 'imgNotReferredToByColorAlone', '14-3.html');
equal(quailTest.results[quailTest.testName][0].attr('src'), 'resources/kids.jpg', 'Item attribute check');
equal(quailTest.results[quailTest.testName].elements[0].attr('src'), 'resources/kids.jpg', 'Item attribute check');
});
</script>
</body>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ <h1>Clayton's Class</h1>
<script id="qunit-script">
test('imgNotReferredToByColorAlone', function() {
quailTest.runTest( 'imgNotReferredToByColorAlone', '14-1.html');
equal(quailTest.results[quailTest.testName][0].attr('src'), 'resources/kids.jpg', 'Item attribute check');
equal(quailTest.results[quailTest.testName].elements[0].attr('src'), 'resources/kids.jpg', 'Item attribute check');
});
</script>
</body>
Expand Down
2 changes: 1 addition & 1 deletion test/testfiles/common/imgWithMapHasUseMap-fail.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<script id="qunit-script">
test('imgWithMapHasUseMap', function() {
quailTest.runTest( 'imgWithMapHasUseMap', '12-1.html');
equal(quailTest.results[quailTest.testName][0].attr('src'), 'resources/image.gif', 'Item attribute check');
equal(quailTest.results[quailTest.testName].elements[0].attr('src'), 'resources/image.gif', 'Item attribute check');
});
</script>
</body>
Expand Down
Loading

0 comments on commit 4fc83b9

Please sign in to comment.