annotate DataTables-1.9.4/media/unit_testing/tests_onhold/6_delayed_rendering/_zero_config.js @ 0:ac5f9272033b draft

first upload
author saskia-hiltemann
date Tue, 01 Jul 2014 11:42:23 -0400
parents
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( "Sanity checks for DataTables with delayed DOM creation" );
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 var oInit = {
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
6 "sAjaxSource": "../../../examples/ajax/sources/arrays.txt",
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
7 "bDeferRender": true
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
8 };
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
9 $('#example').dataTable( oInit );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
10
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
11 oTest.fnWaitTest(
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
12 "10 rows shown on the first page",
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
13 null,
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
14 function () { return $('#example tbody tr').length == 10; }
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
15 );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
16
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
17 oTest.fnWaitTest(
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
18 "10 TR elements available from fnGetNodes",
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
19 null,
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
20 function () { return $('#example').dataTable().fnGetNodes().length == 10; }
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
21 );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
22
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
23 oTest.fnTest(
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
24 "Initial sort occured",
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
25 null,
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
26 function () { return $('#example tbody td:eq(0)').html() == "Gecko"; }
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 oTest.fnTest(
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
30 "Sorting (first click) on second column",
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
31 function () { $('#example thead th:eq(1)').click(); },
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
32 function () { return $('#example tbody td:eq(1)').html() == "All others"; }
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
33 );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
34
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
35 oTest.fnWaitTest(
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
36 "14 TR elements available from fnGetNodes after sort",
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
37 null,
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
38 function () { return $('#example').dataTable().fnGetNodes().length == 14; }
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 oTest.fnTest(
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
42 "Sorting (second click) on second column",
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
43 function () { $('#example thead th:eq(1)').click(); },
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
44 function () { return $('#example tbody td:eq(1)').html() == "Seamonkey 1.1"; }
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 "Sorting (third click) on second column",
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
49 function () { $('#example thead th:eq(1)').click(); },
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
50 function () { return $('#example tbody td:eq(1)').html() == "All others"; }
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
51 );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
52
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
53 oTest.fnTest(
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
54 "Sorting (first click) on numeric column",
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
55 function () { $('#example thead th:eq(3)').click(); },
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
56 function () { return $('#example tbody td:eq(3)').html() == "-"; }
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.fnTest(
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
60 "Sorting (second click) on numeric column",
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
61 function () { $('#example thead th:eq(3)').click(); },
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
62 function () { return $('#example tbody td:eq(3)').html() == "522.1"; }
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
63 );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
64
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
65 oTest.fnTest(
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
66 "Sorting multi-column (first click)",
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
67 function () {
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
68 $('#example thead th:eq(0)').click();
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
69 oDispacher.click( $('#example thead th:eq(1)')[0], { 'shift': true } ); },
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
70 function () { var b =
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
71 $('#example tbody td:eq(0)').html() == "Gecko" &&
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
72 $('#example tbody td:eq(1)').html() == "Camino 1.0"; return b; }
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
73 );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
74
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
75 oTest.fnTest(
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
76 "Sorting multi-column - sorting second column only",
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
77 function () {
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
78 $('#example thead th:eq(1)').click(); },
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
79 function () { return $('#example tbody td:eq(1)').html() == "All others"; }
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
80 );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
81
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
82 /* Basic paging */
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
83 oTest.fnTest(
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
84 "Paging to second page",
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
85 function () { $('#example_next').click(); },
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
86 function () { return $('#example tbody td:eq(1)').html() == "IE Mobile"; }
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
87 );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
88
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
89 oTest.fnTest(
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
90 "Paging to first page",
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
91 function () { $('#example_previous').click(); },
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
92 function () { return $('#example tbody td:eq(1)').html() == "All others"; }
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
93 );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
94
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
95 oTest.fnTest(
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
96 "Attempting to page back beyond the first page",
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
97 function () { $('#example_previous').click(); },
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
98 function () { return $('#example tbody td:eq(1)').html() == "All others"; }
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
99 );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
100
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
101 /* Changing length */
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
102 oTest.fnTest(
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
103 "Changing table length to 25 records",
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
104 function () { $("select[name=example_length]").val('25').change(); },
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
105 function () { return $('#example tbody tr').length == 25; }
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
106 );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
107
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
108 oTest.fnTest(
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
109 "Changing table length to 50 records",
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
110 function () { $("select[name=example_length]").val('50').change(); },
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
111 function () { return $('#example tbody tr').length == 50; }
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
112 );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
113
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
114 oTest.fnTest(
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
115 "Changing table length to 100 records",
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
116 function () { $("select[name=example_length]").val('100').change(); },
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
117 function () { return $('#example tbody tr').length == 57; }
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
118 );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
119
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
120 oTest.fnTest(
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
121 "Changing table length to 10 records",
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
122 function () { $("select[name=example_length]").val('10').change(); },
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
123 function () { return $('#example tbody tr').length == 10; }
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
124 );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
125
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
126 /*
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
127 * Information element
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
128 */
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
129 oTest.fnTest(
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
130 "Information on zero config",
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
131 null,
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
132 function () { return document.getElementById('example_info').innerHTML == "Showing 1 to 10 of 57 entries"; }
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
133 );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
134
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
135 oTest.fnTest(
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
136 "Information on second page",
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
137 function () { $('#example_next').click(); },
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
138 function () { return document.getElementById('example_info').innerHTML == "Showing 11 to 20 of 57 entries"; }
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
139 );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
140
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
141 oTest.fnTest(
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
142 "Information on third page",
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
143 function () { $('#example_next').click(); },
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
144 function () { return document.getElementById('example_info').innerHTML == "Showing 21 to 30 of 57 entries"; }
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
145 );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
146
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
147 oTest.fnTest(
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
148 "Information on last page",
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
149 function () {
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
150 $('#example_next').click();
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
151 $('#example_next').click();
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
152 $('#example_next').click();
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
153 },
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
154 function () { return document.getElementById('example_info').innerHTML == "Showing 51 to 57 of 57 entries"; }
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
155 );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
156
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
157 oTest.fnTest(
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
158 "Information back on first page",
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
159 function () {
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
160 $('#example_previous').click();
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
161 $('#example_previous').click();
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
162 $('#example_previous').click();
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
163 $('#example_previous').click();
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
164 $('#example_previous').click();
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
165 },
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
166 function () { return document.getElementById('example_info').innerHTML == "Showing 1 to 10 of 57 entries"; }
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
167 );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
168
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
169 oTest.fnTest(
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
170 "Information with 25 records",
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
171 function () { $("select[name=example_length]").val('25').change(); },
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
172 function () { return document.getElementById('example_info').innerHTML == "Showing 1 to 25 of 57 entries"; }
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
173 );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
174
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
175 oTest.fnTest(
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
176 "Information with 25 records - second page",
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
177 function () { $('#example_next').click(); },
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
178 function () { return document.getElementById('example_info').innerHTML == "Showing 26 to 50 of 57 entries"; }
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
179 );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
180
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
181 oTest.fnTest(
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
182 "Information with 100 records - first page",
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
183 function () {
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
184 $('#example_previous').click();
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
185 $("select[name=example_length]").val('100').change();
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
186 },
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
187 function () { return document.getElementById('example_info').innerHTML == "Showing 1 to 57 of 57 entries"; }
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
188 );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
189
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
190 oTest.fnTest(
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
191 "Information back to 10 records",
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
192 function () {
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
193 $('#example_previous').click();
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
194 $("select[name=example_length]").val('10').change();
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
195 },
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
196 function () { return document.getElementById('example_info').innerHTML == "Showing 1 to 10 of 57 entries"; }
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
197 );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
198
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
199 oTest.fnTest(
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
200 "Information with filter 'Win'",
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
201 function () { $('#example_filter input').val("Win").keyup(); },
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
202 function () { return document.getElementById('example_info').innerHTML ==
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
203 "Showing 1 to 10 of 31 entries (filtered from 57 total entries)"; }
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
204 );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
205
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
206 oTest.fnTest(
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
207 "Information with filter 'Win' second page",
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
208 function () { $('#example_next').click(); },
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
209 function () { return document.getElementById('example_info').innerHTML ==
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
210 "Showing 11 to 20 of 31 entries (filtered from 57 total entries)"; }
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
211 );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
212
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
213 oTest.fnTest(
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
214 "Information with filter 'Win' last page",
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
215 function () {
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
216 $('#example_next').click();
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
217 $('#example_next').click();
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
218 },
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
219 function () { return document.getElementById('example_info').innerHTML ==
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
220 "Showing 31 to 31 of 31 entries (filtered from 57 total entries)"; }
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
221 );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
222
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
223 oTest.fnTest(
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
224 "Information with filter 'Win' back to first page",
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
225 function () {
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
226 $('#example_previous').click();
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
227 $('#example_previous').click();
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
228 $('#example_previous').click();
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
229 },
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
230 function () { return document.getElementById('example_info').innerHTML ==
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
231 "Showing 1 to 10 of 31 entries (filtered from 57 total entries)"; }
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
232 );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
233
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
234 oTest.fnTest(
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
235 "Information with filter 'Win' second page - second time",
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
236 function () {
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
237 $('#example_next').click();
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
238 },
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
239 function () { return document.getElementById('example_info').innerHTML ==
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
240 "Showing 11 to 20 of 31 entries (filtered from 57 total entries)"; }
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
241 );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
242
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
243 oTest.fnTest(
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
244 "Information with filter increased to 'Win 98'",
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
245 function () { $('#example_filter input').val("Win 98").keyup(); },
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
246 function () { return document.getElementById('example_info').innerHTML ==
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
247 "Showing 1 to 9 of 9 entries (filtered from 57 total entries)"; }
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
248 );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
249
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
250 oTest.fnTest(
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
251 "Information with filter decreased to 'Win'",
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
252 function () { $('#example_filter input').val("Win").keyup(); },
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
253 function () { return document.getElementById('example_info').innerHTML ==
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
254 "Showing 1 to 10 of 31 entries (filtered from 57 total entries)"; }
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
255 );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
256
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
257 oTest.fnTest(
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
258 "Information with filter 'Win' second page - third time",
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
259 function () {
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
260 $('#example_next').click();
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
261 },
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
262 function () { return document.getElementById('example_info').innerHTML ==
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
263 "Showing 11 to 20 of 31 entries (filtered from 57 total entries)"; }
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
264 );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
265
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
266 oTest.fnTest(
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
267 "Information with filter removed",
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
268 function () { $('#example_filter input').val("").keyup(); },
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
269 function () { return document.getElementById('example_info').innerHTML ==
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
270 "Showing 1 to 10 of 57 entries"; }
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
271 );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
272
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
273
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
274 /*
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
275 * Filtering
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
276 */
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
277 oTest.fnWaitTest(
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
278 "Filter 'W' - rows",
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
279 function () {
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
280 /* Reset the table such that the old sorting doesn't mess things up */
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
281 oSession.fnRestore();
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
282 $('#example').dataTable( oInit );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
283 $('#example_filter input').val("W").keyup(); },
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
284 function () { return $('#example tbody tr:eq(0) td:eq(0)').html() == "Gecko"; }
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
285 );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
286
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
287 oTest.fnTest(
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
288 "Filter 'W' - info",
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
289 null,
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
290 function () { return document.getElementById('example_info').innerHTML ==
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
291 "Showing 1 to 10 of 42 entries (filtered from 57 total entries)"; }
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
292 );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
293
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
294 oTest.fnTest(
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
295 "Filter 'Wi'",
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
296 function () { $('#example_filter input').val("Wi").keyup(); },
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
297 function () { return document.getElementById('example_info').innerHTML ==
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
298 "Showing 1 to 10 of 32 entries (filtered from 57 total entries)"; }
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
299 );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
300
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
301 oTest.fnTest(
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
302 "Filter 'Win'",
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
303 function () { $('#example_filter input').val("Win").keyup(); },
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
304 function () { return document.getElementById('example_info').innerHTML ==
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
305 "Showing 1 to 10 of 31 entries (filtered from 57 total entries)"; }
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
306 );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
307
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
308 oTest.fnTest(
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
309 "Filter 'Win' - sorting column 1",
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
310 function () { $('#example thead th:eq(1)').click(); },
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
311 function () { return $('#example tbody tr:eq(0) td:eq(1)').html() == "AOL browser (AOL desktop)"; }
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
312 );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
313
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
314 oTest.fnTest(
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
315 "Filter 'Win' - sorting column 1 info",
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
316 null,
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
317 function () { return document.getElementById('example_info').innerHTML ==
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
318 "Showing 1 to 10 of 31 entries (filtered from 57 total entries)"; }
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
319 );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
320
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
321 oTest.fnTest(
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
322 "Filter 'Win' - sorting column 1 reverse",
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
323 function () { $('#example thead th:eq(1)').click(); },
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
324 function () { return $('#example tbody tr:eq(0) td:eq(1)').html() == "Seamonkey 1.1"; }
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
325 );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
326
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
327 oTest.fnTest(
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
328 "Filter 'Win XP' - maintaing reverse sorting col 1",
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
329 function () { $('#example_filter input').val("Win XP").keyup(); },
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
330 function () { return $('#example tbody tr:eq(0) td:eq(1)').html() == "Internet Explorer 7"; }
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
331 );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
332
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
333 oTest.fnTest(
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
334 "Filter 'Win XP' - sorting col 3",
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
335 function () { $('#example thead th:eq(3)').click(); },
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
336 function () { return $('#example tbody tr:eq(0) td:eq(3)').html() == "4"; }
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
337 );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
338
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
339 oTest.fnTest(
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
340 "Filter 'Win XP' - sorting col 3 - reversed",
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
341 function () { $('#example thead th:eq(3)').click(); },
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
342 function () { return $('#example tbody tr:eq(0) td:eq(3)').html() == "7"; }
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
343 );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
344
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
345 oTest.fnTest(
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
346 "Filter 'Win' - sorting col 3 - reversed info",
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
347 null,
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
348 function () { return document.getElementById('example_info').innerHTML ==
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
349 "Showing 1 to 6 of 6 entries (filtered from 57 total entries)"; }
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
350 );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
351
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
352 oTest.fnTest(
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
353 "Filter 'nothinghere'",
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
354 function () { $('#example_filter input').val("nothinghere").keyup(); },
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
355 function () { return $('#example tbody tr:eq(0) td:eq(0)').html() ==
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
356 "No matching records found"; }
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
357 );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
358
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
359 oTest.fnTest(
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
360 "Filter 'nothinghere' - info",
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
361 null,
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
362 function () { return document.getElementById('example_info').innerHTML ==
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
363 "Showing 0 to 0 of 0 entries (filtered from 57 total entries)"; }
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
364 );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
365
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
366 oTest.fnTest(
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
367 "Filter back to blank and 1st column sorting",
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
368 function () {
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
369 $('#example_filter input').val("").keyup();
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
370 $('#example thead th:eq(0)').click();
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
371 },
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
372 function () { return document.getElementById('example_info').innerHTML ==
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
373 "Showing 1 to 10 of 57 entries"; }
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
374 );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
375
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
376 oTest.fnTest(
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
377 "Prefixing a filter entry",
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
378 function () {
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
379 $('#example_filter input').val("Win").keyup();
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
380 $('#example_filter input').val("GeckoWin").keyup();
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
381 },
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
382 function () { return document.getElementById('example_info').innerHTML ==
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
383 "Showing 0 to 0 of 0 entries (filtered from 57 total entries)"; }
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
384 );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
385
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
386 oTest.fnTest(
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
387 "Prefixing a filter entry with space",
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
388 function () {
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
389 $('#example_filter input').val("Gecko Win").keyup();
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
390 },
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
391 function () { return document.getElementById('example_info').innerHTML ==
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
392 "Showing 1 to 10 of 17 entries (filtered from 57 total entries)"; }
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
393 );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
394
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
395
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
396
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
397
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
398
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
399
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
400
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
401
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
402 oTest.fnComplete();
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
403 } );