Mercurial > repos > saskia-hiltemann > ireport
comparison DataTables-1.9.4/media/unit_testing/tests_onhold/6_delayed_rendering/aoColumns.bVisible.js @ 0:ac5f9272033b draft
first upload
author | saskia-hiltemann |
---|---|
date | Tue, 01 Jul 2014 11:42:23 -0400 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:ac5f9272033b |
---|---|
1 // DATA_TEMPLATE: empty_table | |
2 oTest.fnStart( "aoColumns.bVisible" ); | |
3 | |
4 $(document).ready( function () { | |
5 /* Check the default */ | |
6 var oTable = $('#example').dataTable( { | |
7 "sAjaxSource": "../../../examples/ajax/sources/arrays.txt", | |
8 "bDeferRender": true | |
9 } ); | |
10 var oSettings = oTable.fnSettings(); | |
11 | |
12 oTest.fnWaitTest( | |
13 "All columns are visible by default", | |
14 null, | |
15 function () { return $('#example tbody tr:eq(0) td').length == 5; } | |
16 ); | |
17 | |
18 oTest.fnWaitTest( | |
19 "Can hide one column and it removes td column from DOM", | |
20 function () { | |
21 oSession.fnRestore(); | |
22 $('#example').dataTable( { | |
23 "sAjaxSource": "../../../examples/ajax/sources/arrays.txt", | |
24 "bDeferRender": true, | |
25 "aoColumns": [ | |
26 null, | |
27 { "bVisible": false }, | |
28 null, | |
29 null, | |
30 null | |
31 ] | |
32 } ); | |
33 }, | |
34 function () { return $('#example tbody tr:eq(0) td').length == 4; } | |
35 ); | |
36 | |
37 oTest.fnWaitTest( | |
38 "Can hide one column and it removes thead th column from DOM", | |
39 null, | |
40 function () { return $('#example thead tr:eq(0) th').length == 4; } | |
41 ); | |
42 | |
43 oTest.fnWaitTest( | |
44 "The correct thead column has been hidden", | |
45 null, | |
46 function () { | |
47 var jqNodes = $('#example thead tr:eq(0) th'); | |
48 var bReturn = | |
49 jqNodes[0].innerHTML == "Rendering engine" && | |
50 jqNodes[1].innerHTML == "Platform(s)" && | |
51 jqNodes[2].innerHTML == "Engine version" && | |
52 jqNodes[3].innerHTML == "CSS grade"; | |
53 return bReturn; | |
54 } | |
55 ); | |
56 | |
57 oTest.fnWaitTest( | |
58 "The correct tbody column has been hidden", | |
59 function () { | |
60 oDispacher.click( $('#example thead th:eq(1)')[0], { 'shift': true } ); | |
61 }, | |
62 function () { | |
63 var jqNodes = $('#example tbody tr:eq(0) td'); | |
64 var bReturn = | |
65 jqNodes[0].innerHTML == "Gecko" && | |
66 jqNodes[1].innerHTML == "Gnome" && | |
67 jqNodes[2].innerHTML == "1.8" && | |
68 jqNodes[3].innerHTML == "A"; | |
69 return bReturn; | |
70 } | |
71 ); | |
72 | |
73 | |
74 oTest.fnWaitTest( | |
75 "Can hide multiple columns and it removes td column from DOM", | |
76 function () { | |
77 oSession.fnRestore(); | |
78 $('#example').dataTable( { | |
79 "sAjaxSource": "../../../examples/ajax/sources/arrays.txt", | |
80 "bDeferRender": true, | |
81 "aoColumns": [ | |
82 null, | |
83 { "bVisible": false }, | |
84 { "bVisible": false }, | |
85 null, | |
86 { "bVisible": false } | |
87 ] | |
88 } ); | |
89 }, | |
90 function () { return $('#example tbody tr:eq(0) td').length == 2; } | |
91 ); | |
92 | |
93 oTest.fnWaitTest( | |
94 "Multiple hide - removes thead th column from DOM", | |
95 null, | |
96 function () { return $('#example thead tr:eq(0) th').length == 2; } | |
97 ); | |
98 | |
99 oTest.fnWaitTest( | |
100 "Multiple hide - the correct thead columns have been hidden", | |
101 null, | |
102 function () { | |
103 var jqNodes = $('#example thead tr:eq(0) th'); | |
104 var bReturn = | |
105 jqNodes[0].innerHTML == "Rendering engine" && | |
106 jqNodes[1].innerHTML == "Engine version" | |
107 return bReturn; | |
108 } | |
109 ); | |
110 | |
111 oTest.fnWaitTest( | |
112 "Multiple hide - the correct tbody columns have been hidden", | |
113 function () { | |
114 oDispacher.click( $('#example thead th:eq(1)')[0], { 'shift': true } ); | |
115 }, | |
116 function () { | |
117 var jqNodes = $('#example tbody tr:eq(0) td'); | |
118 var bReturn = | |
119 jqNodes[0].innerHTML == "Gecko" && | |
120 jqNodes[1].innerHTML == "1" | |
121 return bReturn; | |
122 } | |
123 ); | |
124 | |
125 | |
126 oTest.fnComplete(); | |
127 } ); |