X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=webapp%2Fresources%2Fdatatables-1.9.4%2Fmedia%2Funit_testing%2Ftests_onhold%2F3_ajax%2FiDisplayLength.js;fp=webapp%2Fresources%2Fdatatables-1.9.4%2Fmedia%2Funit_testing%2Ftests_onhold%2F3_ajax%2FiDisplayLength.js;h=69e7abed86a5214235717cf801018522cf574e72;hb=9bb6ee99ca7f738fac1087190b5481b8fe6e8d9f;hp=0000000000000000000000000000000000000000;hpb=2e3f6b76be585306f1003d849831840c0adb3360;p=proteocache.git diff --git a/webapp/resources/datatables-1.9.4/media/unit_testing/tests_onhold/3_ajax/iDisplayLength.js b/webapp/resources/datatables-1.9.4/media/unit_testing/tests_onhold/3_ajax/iDisplayLength.js new file mode 100644 index 0000000..69e7abe --- /dev/null +++ b/webapp/resources/datatables-1.9.4/media/unit_testing/tests_onhold/3_ajax/iDisplayLength.js @@ -0,0 +1,81 @@ +// DATA_TEMPLATE: empty_table +oTest.fnStart( "iDisplayLength" ); + +$(document).ready( function () { + /* Check the default */ + $('#example').dataTable( { + "sAjaxSource": "../../../examples/ajax/sources/arrays.txt" + } ); + + oTest.fnWaitTest( + "Default length is ten", + null, + function () { return $('#example tbody tr').length == 10; } + ); + + oTest.fnWaitTest( + "Select menu shows 10", + null, + function () { return $('#example_length select').val() == 10; } + ); + + + oTest.fnWaitTest( + "Set initial length to 25", + function () { + oSession.fnRestore(); + $('#example').dataTable( { + "sAjaxSource": "../../../examples/ajax/sources/arrays.txt", + "iDisplayLength": 25 + } ); + }, + function () { return $('#example tbody tr').length == 25; } + ); + + oTest.fnWaitTest( + "Select menu shows 25", + null, + function () { return $('#example_length select').val() == 25; } + ); + + + oTest.fnWaitTest( + "Set initial length to 100", + function () { + oSession.fnRestore(); + $('#example').dataTable( { + "sAjaxSource": "../../../examples/ajax/sources/arrays.txt", + "iDisplayLength": 100 + } ); + }, + function () { return $('#example tbody tr').length == 57; } + ); + + oTest.fnWaitTest( + "Select menu shows 25", + null, + function () { return $('#example_length select').val() == 100; } + ); + + + oTest.fnWaitTest( + "Set initial length to 23 (unknown select menu length)", + function () { + oSession.fnRestore(); + $('#example').dataTable( { + "sAjaxSource": "../../../examples/ajax/sources/arrays.txt", + "iDisplayLength": 23 + } ); + }, + function () { return $('#example tbody tr').length == 23; } + ); + + oTest.fnWaitTest( + "Select menu shows 10 (since 23 is unknow)", + null, + function () { return $('#example_length select').val() == 10; } + ); + + + oTest.fnComplete(); +} ); \ No newline at end of file