X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=webapp%2Fresources%2Fdatatables-1.9.4%2Fmedia%2Funit_testing%2Ftests_onhold%2F6_delayed_rendering%2FoLanguage.sZeroRecords.js;fp=webapp%2Fresources%2Fdatatables-1.9.4%2Fmedia%2Funit_testing%2Ftests_onhold%2F6_delayed_rendering%2FoLanguage.sZeroRecords.js;h=b1a17a241cdddb8e5599af491e6c1c701fcff918;hb=9bb6ee99ca7f738fac1087190b5481b8fe6e8d9f;hp=0000000000000000000000000000000000000000;hpb=2e3f6b76be585306f1003d849831840c0adb3360;p=proteocache.git diff --git a/webapp/resources/datatables-1.9.4/media/unit_testing/tests_onhold/6_delayed_rendering/oLanguage.sZeroRecords.js b/webapp/resources/datatables-1.9.4/media/unit_testing/tests_onhold/6_delayed_rendering/oLanguage.sZeroRecords.js new file mode 100644 index 0000000..b1a17a2 --- /dev/null +++ b/webapp/resources/datatables-1.9.4/media/unit_testing/tests_onhold/6_delayed_rendering/oLanguage.sZeroRecords.js @@ -0,0 +1,50 @@ +// DATA_TEMPLATE: empty_table +oTest.fnStart( "oLanguage.sZeroRecords" ); + +$(document).ready( function () { + /* Check the default */ + var oTable = $('#example').dataTable( { + "sAjaxSource": "../../../examples/ajax/sources/arrays.txt", + "bDeferRender": true + } ); + var oSettings = oTable.fnSettings(); + + oTest.fnWaitTest( + "Zero records language is 'No matching records found' by default", + null, + function () { return oSettings.oLanguage.sZeroRecords == "No matching records found"; } + ); + + oTest.fnWaitTest( + "Text is shown when empty table (after filtering)", + function () { oTable.fnFilter('nothinghere'); }, + function () { return $('#example tbody tr td')[0].innerHTML == "No matching records found" } + ); + + + + oTest.fnWaitTest( + "Zero records language can be defined", + function () { + oSession.fnRestore(); + oTable = $('#example').dataTable( { + "sAjaxSource": "../../../examples/ajax/sources/arrays.txt", + "bDeferRender": true, + "oLanguage": { + "sZeroRecords": "unit test" + } + } ); + oSettings = oTable.fnSettings(); + }, + function () { return oSettings.oLanguage.sZeroRecords == "unit test"; } + ); + + oTest.fnWaitTest( + "Text is shown when empty table (after filtering)", + function () { oTable.fnFilter('nothinghere2'); }, + function () { return $('#example tbody tr td')[0].innerHTML == "unit test" } + ); + + + oTest.fnComplete(); +} ); \ No newline at end of file