Add datatables-1.9.4 and jquery-1.10.2 libraries
[proteocache.git] / webapp / resources / datatables-1.9.4 / media / unit_testing / tests_onhold / 2_js / oLanguage.sInfoPostFix.js
1 // DATA_TEMPLATE: js_data
2 oTest.fnStart( "oLanguage.sInfoPostFix" );
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                 "Info post fix language is '' (blank) by default",
13                 null,
14                 function () { return oSettings.oLanguage.sInfoPostFix == ""; }
15         );
16         
17         oTest.fnTest( 
18                 "Width no post fix, the basic info shows",
19                 null,
20                 function () { return document.getElementById('example_info').innerHTML = "Showing 1 to 10 of 57 entries"; }
21         );
22         
23         
24         oTest.fnTest( 
25                 "Info post fix language can be defined",
26                 function () {
27                         oSession.fnRestore();
28                         oTable = $('#example').dataTable( {
29                                 "aaData": gaaData,
30                                 "oLanguage": {
31                                         "sInfoPostFix": "unit test"
32                                 }
33                         } );
34                         oSettings = oTable.fnSettings();
35                 },
36                 function () { return oSettings.oLanguage.sInfoPostFix == "unit test"; }
37         );
38         
39         oTest.fnTest( 
40                 "Info empty language default is in the DOM",
41                 null,
42                 function () { return document.getElementById('example_info').innerHTML = "Showing 1 to 10 of 57 entries unit test"; }
43         );
44         
45         
46         oTest.fnTest( 
47                 "Macros have no effect in the post fix",
48                 function () {
49                         oSession.fnRestore();
50                         oTable = $('#example').dataTable( {
51                                 "aaData": gaaData,
52                                 "oLanguage": {
53                                         "sInfoPostFix": "unit _START_ _END_ _TOTAL_ test"
54                                 }
55                         } );
56                 },
57                 function () { return document.getElementById('example_info').innerHTML = "Showing 1 to 10 of 57 entries unit _START_ _END_ _TOTAL_ test"; }
58         );
59         
60         
61         oTest.fnTest( 
62                 "Post fix is applied after fintering info",
63                 function () {
64                         oSession.fnRestore();
65                         oTable = $('#example').dataTable( {
66                                 "aaData": gaaData,
67                                 "oLanguage": {
68                                         "sInfoPostFix": "unit test"
69                                 }
70                         } );
71                         oTable.fnFilter("nothinghere");
72                 },
73                 function () { return document.getElementById('example_info').innerHTML = "Showing 0 to 0 of 0 entries unit (filtered from 57 total entries) test"; }
74         );
75         
76         
77         oTest.fnComplete();
78 } );