/[projects]/misc/horsensspejder-web/jquery/DataTables-1.9.4/media/unit_testing/tests_onhold/5_ajax_objects/oLanguage.sInfoEmpty.js
ViewVC logotype

Contents of /misc/horsensspejder-web/jquery/DataTables-1.9.4/media/unit_testing/tests_onhold/5_ajax_objects/oLanguage.sInfoEmpty.js

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2125 - (show annotations) (download) (as text)
Wed Mar 12 19:30:05 2014 UTC (10 years, 3 months ago) by torben
File MIME type: application/javascript
File size: 2762 byte(s)
initial import
1 // DATA_TEMPLATE: empty_table
2 oTest.fnStart( "oLanguage.sInfoEmpty" );
3
4 $(document).ready( function () {
5 /* Check the default */
6 var oTable = $('#example').dataTable( {
7 "sAjaxSource": "../../../examples/ajax/sources/objects.txt",
8 "aoColumns": [
9 { "mData": "engine" },
10 { "mData": "browser" },
11 { "mData": "platform" },
12 { "mData": "version" },
13 { "mData": "grade" }
14 ]
15 } );
16 var oSettings = oTable.fnSettings();
17
18 oTest.fnWaitTest(
19 "Info empty language is 'Showing 0 to 0 of 0 entries' by default",
20 function () { oTable.fnFilter("nothinghere"); },
21 function () { return oSettings.oLanguage.sInfoEmpty == "Showing 0 to 0 of 0 entries"; }
22 );
23
24 oTest.fnTest(
25 "Info empty language default is in the DOM",
26 null,
27 function () {
28 var bReturn = document.getElementById('example_info').innerHTML.replace(
29 ' '+oSettings.oLanguage.sInfoFiltered.replace( '_MAX_', '57' ), "" ) ==
30 "Showing 0 to 0 of 0 entries";
31 return bReturn;
32 }
33 );
34
35
36 oTest.fnWaitTest(
37 "Info empty language can be defined",
38 function () {
39 oSession.fnRestore();
40 oTable = $('#example').dataTable( {
41 "sAjaxSource": "../../../examples/ajax/sources/objects.txt",
42 "aoColumnDefs": [
43 { "mData": "engine", "aTargets": [0] },
44 { "mData": "browser", "aTargets": [1] },
45 { "mData": "platform", "aTargets": [2] },
46 { "mData": "version", "aTargets": [3] },
47 { "mData": "grade", "aTargets": [4] }
48 ],
49 "oLanguage": {
50 "sInfoEmpty": "unit test"
51 }
52 } );
53 oSettings = oTable.fnSettings();
54 oTable.fnFilter("nothinghere");
55 },
56 function () { return oSettings.oLanguage.sInfoEmpty == "unit test"; }
57 );
58
59 oTest.fnTest(
60 "Info empty language default is in the DOM",
61 null,
62 function () {
63 var bReturn = document.getElementById('example_info').innerHTML.replace(
64 ' '+oSettings.oLanguage.sInfoFiltered.replace( '_MAX_', '57' ), "" ) ==
65 "unit test";
66 return bReturn;
67 }
68 );
69
70
71 oTest.fnWaitTest(
72 "Macro's replaced",
73 function () {
74 oSession.fnRestore();
75 oTable = $('#example').dataTable( {
76 "sAjaxSource": "../../../examples/ajax/sources/objects.txt",
77 "aoColumnDefs": [
78 { "mData": "engine", "aTargets": [0] },
79 { "mData": "browser", "aTargets": [1] },
80 { "mData": "platform", "aTargets": [2] },
81 { "mData": "version", "aTargets": [3] },
82 { "mData": "grade", "aTargets": [4] }
83 ],
84 "oLanguage": {
85 "sInfoEmpty": "unit _START_ _END_ _TOTAL_ test"
86 }
87 } );
88 oTable.fnFilter("nothinghere");
89 },
90 function () {
91 var bReturn = document.getElementById('example_info').innerHTML.replace(
92 ' '+oSettings.oLanguage.sInfoFiltered.replace( '_MAX_', '57' ), "" ) ==
93 "unit 1 0 0 test";
94 return bReturn;
95 }
96 );
97
98
99 oTest.fnComplete();
100 } );

  ViewVC Help
Powered by ViewVC 1.1.20