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%2FoLanguage.sZeroRecords.js;fp=webapp%2Fresources%2Fdatatables-1.9.4%2Fmedia%2Funit_testing%2Ftests_onhold%2F3_ajax%2FoLanguage.sZeroRecords.js;h=7dffc1517a857a09d893274f3e2fde9718b790d9;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/oLanguage.sZeroRecords.js b/webapp/resources/datatables-1.9.4/media/unit_testing/tests_onhold/3_ajax/oLanguage.sZeroRecords.js new file mode 100644 index 0000000..7dffc15 --- /dev/null +++ b/webapp/resources/datatables-1.9.4/media/unit_testing/tests_onhold/3_ajax/oLanguage.sZeroRecords.js @@ -0,0 +1,48 @@ +// DATA_TEMPLATE: empty_table +oTest.fnStart( "oLanguage.sZeroRecords" ); + +$(document).ready( function () { + /* Check the default */ + var oTable = $('#example').dataTable( { + "sAjaxSource": "../../../examples/ajax/sources/arrays.txt" + } ); + 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", + "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