Add datatables-1.9.4 and jquery-1.10.2 libraries
[proteocache.git] / webapp / resources / datatables-1.9.4 / media / unit_testing / tests_onhold / 3_ajax / oLanguage.sZeroRecords.js
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         } );
9         var oSettings = oTable.fnSettings();
10         
11         oTest.fnWaitTest( 
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.fnWaitTest(
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.fnWaitTest( 
26                 "Zero records language can be defined",
27                 function () {
28                         oSession.fnRestore();
29                         oTable = $('#example').dataTable( {
30                                 "sAjaxSource": "../../../examples/ajax/sources/arrays.txt",
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.fnWaitTest(
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 } );