Add datatables-1.9.4 and jquery-1.10.2 libraries
[proteocache.git] / webapp / resources / datatables-1.9.4 / media / unit_testing / tests_onhold / 1_dom / oLanguage.sInfoEmpty.js
1 // DATA_TEMPLATE: dom_data
2 oTest.fnStart( "oLanguage.sInfoEmpty" );
3
4 $(document).ready( function () {
5         /* Check the default */
6         var oTable = $('#example').dataTable();
7         var oSettings = oTable.fnSettings();
8         
9         oTest.fnTest( 
10                 "Info empty language is 'Showing 0 to 0 of 0 entries' by default",
11                 function () { oTable.fnFilter("nothinghere"); },
12                 function () { return oSettings.oLanguage.sInfoEmpty == "Showing 0 to 0 of 0 entries"; }
13         );
14         
15         oTest.fnTest( 
16                 "Info empty language default is in the DOM",
17                 null,
18                 function () {
19                         var bReturn = document.getElementById('example_info').innerHTML.replace( 
20                                 ' '+oSettings.oLanguage.sInfoFiltered.replace( '_MAX_', '57' ), "" ) ==
21                                         "Showing 0 to 0 of 0 entries";
22                         return bReturn;
23                 }
24         );
25         
26         
27         oTest.fnTest( 
28                 "Info empty language can be defined",
29                 function () {
30                         oSession.fnRestore();
31                         oTable = $('#example').dataTable( {
32                                 "oLanguage": {
33                                         "sInfoEmpty": "unit test"
34                                 }
35                         } );
36                         oSettings = oTable.fnSettings();
37                         oTable.fnFilter("nothinghere");
38                 },
39                 function () { return oSettings.oLanguage.sInfoEmpty == "unit test"; }
40         );
41         
42         oTest.fnTest( 
43                 "Info empty language default is in the DOM",
44                 null,
45                 function () {
46                         var bReturn = document.getElementById('example_info').innerHTML.replace( 
47                                 ' '+oSettings.oLanguage.sInfoFiltered.replace( '_MAX_', '57' ), "" ) ==
48                                         "unit test";
49                         return bReturn;
50                 }
51         );
52         
53         
54         oTest.fnTest( 
55                 "Macro's replaced",
56                 function () {
57                         oSession.fnRestore();
58                         oTable = $('#example').dataTable( {
59                                 "oLanguage": {
60                                         "sInfoEmpty": "unit _START_ _END_ _TOTAL_ test"
61                                 }
62                         } );
63                         oTable.fnFilter("nothinghere");
64                 },
65                 function () {
66                         var bReturn = document.getElementById('example_info').innerHTML.replace( 
67                                 ' '+oSettings.oLanguage.sInfoFiltered.replace( '_MAX_', '57' ), "" ) ==
68                                         "unit 1 0 0 test";
69                         return bReturn;
70                 }
71         );
72         
73         
74         oTest.fnComplete();
75 } );