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 tablePositioningShouldNotChangeMeaning test for issue #74.
- Loading branch information
Kevin Miller
committed
Jun 16, 2014
1 parent
1e34ad1
commit fe7566d
Showing
3 changed files
with
158 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,26 @@ | ||
quail.tablePositioningShouldNotChangeMeaning = function(quail, test, Case) { | ||
test.get('$scope').find('table').each(function() { | ||
var _case = test.add(Case({ | ||
element: this, | ||
expected: (function (element) { | ||
return quail.components.resolveExpectation(element); | ||
}(this)) | ||
})); | ||
$(this).find('th, td').each(function() { | ||
if ($(this).css('position') !== 'relative' && | ||
$(this).css('position') !== 'static' || ( | ||
$(this).css('float') === 'right' || | ||
$(this).css('float') === 'left' | ||
)) { | ||
_case.set({ | ||
status : 'failed' | ||
}); | ||
} | ||
else { | ||
_case.set({ | ||
status : 'passed' | ||
}); | ||
} | ||
}); | ||
}); | ||
}; |
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
106 changes: 106 additions & 0 deletions
106
test/accessibility-tests/tablePositioningShouldNotChangeMeaning.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,106 @@ | ||
<!doctype html> | ||
<html> | ||
<head> | ||
<title>tablePositioningShouldNotChangeMeaning</title> | ||
<style> | ||
|
||
#fail-1 td { | ||
position: absolute; | ||
} | ||
|
||
#fail-2 td { | ||
float: right; | ||
} | ||
|
||
</style> | ||
</head> | ||
<body> | ||
<div class="quail-test" data-expected="fail" id="fail-1" data-accessibility-test="tablePositioningShouldNotChangeMeaning"> | ||
<table> | ||
<thead> | ||
<tr> | ||
<th>One</th> | ||
<th>Two</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
<tr> | ||
<td>One</td> | ||
<td>Two</td> | ||
</tr> | ||
<tr> | ||
<td>One B</td> | ||
<td>Two B</td> | ||
</tr> | ||
<tr> | ||
<td>One C</td> | ||
<td>Two C</td> | ||
</tr> | ||
<tr> | ||
<td>One D</td> | ||
<td>Two D</td> | ||
</tr> | ||
</tbody> | ||
</table> | ||
</div> | ||
|
||
<div class="quail-test" data-expected="fail" id="fail-2" data-accessibility-test="tablePositioningShouldNotChangeMeaning"> | ||
<table> | ||
<thead> | ||
<tr> | ||
<th>One</th> | ||
<th>Two</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
<tr> | ||
<td>One</td> | ||
<td>Two</td> | ||
</tr> | ||
<tr> | ||
<td>One B</td> | ||
<td>Two B</td> | ||
</tr> | ||
<tr> | ||
<td>One C</td> | ||
<td>Two C</td> | ||
</tr> | ||
<tr> | ||
<td>One D</td> | ||
<td>Two D</td> | ||
</tr> | ||
</tbody> | ||
</table> | ||
</div> | ||
|
||
<div class="quail-test" data-expected="pass" data-accessibility-test="tablePositioningShouldNotChangeMeaning"> | ||
<table> | ||
<thead> | ||
<tr> | ||
<th>One</th> | ||
<th>Two</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
<tr> | ||
<td>One</td> | ||
<td>Two</td> | ||
</tr> | ||
<tr> | ||
<td>One B</td> | ||
<td>Two B</td> | ||
</tr> | ||
<tr> | ||
<td>One C</td> | ||
<td>Two C</td> | ||
</tr> | ||
<tr> | ||
<td>One D</td> | ||
<td>Two D</td> | ||
</tr> | ||
</tbody> | ||
</table> | ||
</div> | ||
|
||
<script src="../quail-testrunner.js"></script> </body> | ||
</html> |