Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Allan Jardine
committed
May 1, 2014
1 parent
3cb0e3a
commit 4feb895
Showing
1 changed file
with
64 additions
and
0 deletions.
There are no files selected for viewing
64 changes: 64 additions & 0 deletions
64
media/unit_testing/tests_onhold/6776-scrolling-table-grows.js
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,64 @@ | ||
// DATA_TEMPLATE: 6776 | ||
oTest.fnStart( "Actions on a scrolling table keep width" ); | ||
|
||
|
||
$(document).ready( function () { | ||
var oTable = $('#example').dataTable( { | ||
"bFilter": true, | ||
"bSort": true, | ||
"sScrollY": "100px", | ||
"bPaginate": false | ||
} ); | ||
|
||
var iWidth = $('div.dataTables_wrapper').width(); | ||
|
||
oTest.fnTest( | ||
"First sort has no effect on width", | ||
function () { $('th:eq(1)').click(); }, | ||
function () { return $('div.dataTables_wrapper').width() == iWidth; } | ||
); | ||
|
||
oTest.fnTest( | ||
"Second sort has no effect on width", | ||
function () { $('th:eq(1)').click(); }, | ||
function () { return $('div.dataTables_wrapper').width() == iWidth; } | ||
); | ||
|
||
oTest.fnTest( | ||
"Third sort has no effect on width", | ||
function () { $('th:eq(2)').click(); }, | ||
function () { return $('div.dataTables_wrapper').width() == iWidth; } | ||
); | ||
|
||
oTest.fnTest( | ||
"Filter has no effect on width", | ||
function () { oTable.fnFilter('i'); }, | ||
function () { return $('div.dataTables_wrapper').width() == iWidth; } | ||
); | ||
|
||
oTest.fnTest( | ||
"Filter 2 has no effect on width", | ||
function () { oTable.fnFilter('in'); }, | ||
function () { return $('div.dataTables_wrapper').width() == iWidth; } | ||
); | ||
|
||
oTest.fnTest( | ||
"No result filter has header and body at same width", | ||
function () { oTable.fnFilter('xxx'); }, | ||
function () { return $('#example').width() == $('div.dataTables_scrollHeadInner').width(); } | ||
); | ||
|
||
oTest.fnTest( | ||
"Filter with no results has no effect on width", | ||
function () { oTable.fnFilter('xxx'); }, | ||
function () { return $('div.dataTables_wrapper').width() == iWidth; } | ||
); | ||
|
||
oTest.fnTest( | ||
"Filter with no results has table equal to wrapper width", | ||
function () { oTable.fnFilter('xxx'); }, | ||
function () { return $('div.dataTables_wrapper').width() == $('#example').width(); } | ||
); | ||
|
||
oTest.fnComplete(); | ||
} ); |