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