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

Contents of /misc/horsensspejder-web/jquery/DataTables-1.9.4/media/unit_testing/tests_onhold/3_ajax/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: 2093 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/arrays.txt"
8 } );
9 var oSettings = oTable.fnSettings();
10
11 oTest.fnWaitTest(
12 "Info empty language is 'Showing 0 to 0 of 0 entries' by default",
13 function () { oTable.fnFilter("nothinghere"); },
14 function () { return oSettings.oLanguage.sInfoEmpty == "Showing 0 to 0 of 0 entries"; }
15 );
16
17 oTest.fnTest(
18 "Info empty language default is in the DOM",
19 null,
20 function () {
21 var bReturn = document.getElementById('example_info').innerHTML.replace(
22 ' '+oSettings.oLanguage.sInfoFiltered.replace( '_MAX_', '57' ), "" ) ==
23 "Showing 0 to 0 of 0 entries";
24 return bReturn;
25 }
26 );
27
28
29 oTest.fnWaitTest(
30 "Info empty language can be defined",
31 function () {
32 oSession.fnRestore();
33 oTable = $('#example').dataTable( {
34 "sAjaxSource": "../../../examples/ajax/sources/arrays.txt",
35 "oLanguage": {
36 "sInfoEmpty": "unit test"
37 }
38 } );
39 oSettings = oTable.fnSettings();
40 oTable.fnFilter("nothinghere");
41 },
42 function () { return oSettings.oLanguage.sInfoEmpty == "unit test"; }
43 );
44
45 oTest.fnTest(
46 "Info empty language default is in the DOM",
47 null,
48 function () {
49 var bReturn = document.getElementById('example_info').innerHTML.replace(
50 ' '+oSettings.oLanguage.sInfoFiltered.replace( '_MAX_', '57' ), "" ) ==
51 "unit test";
52 return bReturn;
53 }
54 );
55
56
57 oTest.fnWaitTest(
58 "Macro's replaced",
59 function () {
60 oSession.fnRestore();
61 oTable = $('#example').dataTable( {
62 "sAjaxSource": "../../../examples/ajax/sources/arrays.txt",
63 "oLanguage": {
64 "sInfoEmpty": "unit _START_ _END_ _TOTAL_ test"
65 }
66 } );
67 oTable.fnFilter("nothinghere");
68 },
69 function () {
70 var bReturn = document.getElementById('example_info').innerHTML.replace(
71 ' '+oSettings.oLanguage.sInfoFiltered.replace( '_MAX_', '57' ), "" ) ==
72 "unit 1 0 0 test";
73 return bReturn;
74 }
75 );
76
77
78 oTest.fnComplete();
79 } );

  ViewVC Help
Powered by ViewVC 1.1.20