annotate DataTables-1.9.4/media/unit_testing/tests_onhold/6_delayed_rendering/oLanguage.sInfoEmpty.js @ 7:0f2b740536fb draft

Uploaded
author saskia-hiltemann
date Mon, 21 Aug 2017 09:16:07 -0400
parents ac5f9272033b
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
1 // DATA_TEMPLATE: empty_table
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
2 oTest.fnStart( "oLanguage.sInfoEmpty" );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
3
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
4 $(document).ready( function () {
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
5 /* Check the default */
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
6 var oTable = $('#example').dataTable( {
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
7 "sAjaxSource": "../../../examples/ajax/sources/arrays.txt",
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
8 "bDeferRender": true
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
9 } );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
10 var oSettings = oTable.fnSettings();
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
11
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
12 oTest.fnWaitTest(
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
13 "Info empty language is 'Showing 0 to 0 of 0 entries' by default",
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
14 function () { oTable.fnFilter("nothinghere"); },
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
15 function () { return oSettings.oLanguage.sInfoEmpty == "Showing 0 to 0 of 0 entries"; }
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
16 );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
17
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
18 oTest.fnTest(
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
19 "Info empty language default is in the DOM",
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
20 null,
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
21 function () {
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
22 var bReturn = document.getElementById('example_info').innerHTML.replace(
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
23 ' '+oSettings.oLanguage.sInfoFiltered.replace( '_MAX_', '57' ), "" ) ==
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
24 "Showing 0 to 0 of 0 entries";
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
25 return bReturn;
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
26 }
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
27 );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
28
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
29
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
30 oTest.fnWaitTest(
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
31 "Info empty language can be defined",
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
32 function () {
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
33 oSession.fnRestore();
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
34 oTable = $('#example').dataTable( {
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
35 "sAjaxSource": "../../../examples/ajax/sources/arrays.txt",
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
36 "bDeferRender": true,
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
37 "oLanguage": {
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
38 "sInfoEmpty": "unit test"
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
39 }
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
40 } );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
41 oSettings = oTable.fnSettings();
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
42 oTable.fnFilter("nothinghere");
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
43 },
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
44 function () { return oSettings.oLanguage.sInfoEmpty == "unit test"; }
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
45 );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
46
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
47 oTest.fnTest(
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
48 "Info empty language default is in the DOM",
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
49 null,
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
50 function () {
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
51 var bReturn = document.getElementById('example_info').innerHTML.replace(
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
52 ' '+oSettings.oLanguage.sInfoFiltered.replace( '_MAX_', '57' ), "" ) ==
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
53 "unit test";
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
54 return bReturn;
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
55 }
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
56 );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
57
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
58
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
59 oTest.fnWaitTest(
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
60 "Macro's replaced",
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
61 function () {
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
62 oSession.fnRestore();
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
63 oTable = $('#example').dataTable( {
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
64 "sAjaxSource": "../../../examples/ajax/sources/arrays.txt",
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
65 "bDeferRender": true,
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
66 "oLanguage": {
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
67 "sInfoEmpty": "unit _START_ _END_ _TOTAL_ test"
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
68 }
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
69 } );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
70 oTable.fnFilter("nothinghere");
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
71 },
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
72 function () {
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
73 var bReturn = document.getElementById('example_info').innerHTML.replace(
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
74 ' '+oSettings.oLanguage.sInfoFiltered.replace( '_MAX_', '57' ), "" ) ==
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
75 "unit 1 0 0 test";
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
76 return bReturn;
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
77 }
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
78 );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
79
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
80
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
81 oTest.fnComplete();
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
82 } );