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