Debian Codegraph @

old-tests/tests_onhold/6_delayed_rendering/oLanguage.sZeroRecords.js

raw
1 // DATA_TEMPLATE: empty_table
2 oTest.fnStart( "oLanguage.sZeroRecords" );
3
4 $(document).ready( function () {
5 /* Check the default */
6 var oTable = $('#example').dataTable( {
7 "sAjaxSource": "../../../examples/ajax/sources/arrays.txt",
8 "bDeferRender": true
9 } );
10 var oSettings = oTable.fnSettings();
11
12 oTest.fnWaitTest(
13 "Zero records language is 'No matching records found' by default",
14 null,
15 function () { return oSettings.oLanguage.sZeroRecords == "No matching records found"; }
16 );
17
18 oTest.fnWaitTest(
19 "Text is shown when empty table (after filtering)",
20 function () { oTable.fnFilter('nothinghere'); },
21 function () { return $('#example tbody tr td')[0].innerHTML == "No matching records found" }
22 );
23
24
25
26 oTest.fnWaitTest(
27 "Zero records language can be defined",
28 function () {
29 oSession.fnRestore();
30 oTable = $('#example').dataTable( {
31 "sAjaxSource": "../../../examples/ajax/sources/arrays.txt",
32 "bDeferRender": true,
33 "oLanguage": {
34 "sZeroRecords": "unit test"
35 }
36 } );
37 oSettings = oTable.fnSettings();
38 },
39 function () { return oSettings.oLanguage.sZeroRecords == "unit test"; }
40 );
41
42 oTest.fnWaitTest(
43 "Text is shown when empty table (after filtering)",
44 function () { oTable.fnFilter('nothinghere2'); },
45 function () { return $('#example tbody tr td')[0].innerHTML == "unit test" }
46 );
47
48
49 oTest.fnComplete();
50 } );