63857316236d2498e5f02cf63ea1d5f0ea3c1c4b
[myslice.git] / third-party / jquery-ui-1.10.2 / tests / unit / sortable / sortable_options.js
1 /*
2  * sortable_options.js
3  */
4 (function($) {
5
6 module("sortable: options");
7
8 /*
9 test("{ appendTo: 'parent' }, default", function() {
10         ok(false, "missing test - untested code is broken code.");
11 });
12
13 test("{ appendTo: Selector }", function() {
14         ok(false, "missing test - untested code is broken code.");
15 });
16
17 test("{ axis: false }, default", function() {
18         ok(false, "missing test - untested code is broken code.");
19 });
20
21 test("{ axis: 'x' }", function() {
22         ok(false, "missing test - untested code is broken code.");
23 });
24
25 test("{ axis: 'y' }", function() {
26         ok(false, "missing test - untested code is broken code.");
27 });
28
29 test("{ axis: ? }, unexpected", function() {
30         ok(false, "missing test - untested code is broken code.");
31 });
32
33 test("{ cancel: 'input,textarea,button,select,option' }, default", function() {
34         ok(false, "missing test - untested code is broken code.");
35 });
36
37 test("{ cancel: Selector }", function() {
38         ok(false, "missing test - untested code is broken code.");
39 });
40 */
41
42 test( "#8792: issues with floated items in connected lists", function() {
43         expect( 2 );
44
45         var element,
46                 changeCount = 0;
47
48         $( "#qunit-fixture" )
49                 .html( "<ul class='c'><li>a</li><li>a</li></ul><ul class='c'><li>a</li><li>a</li></ul>" )
50                 .find( "ul" ).css({ "float": "left", width: "100px" }).end()
51                 .find( "li" ).css({ "float": "left", width: "50px", height: "50px" });
52
53         $( "#qunit-fixture .c" ).sortable({
54                 connectWith: "#qunit-fixture .c",
55                 change: function() {
56                         changeCount++;
57                 }
58         });
59
60         element = $( "#qunit-fixture li:eq(0)" );
61
62         element.simulate( "drag", {
63                 dx: 51,
64                 moves: 15
65         });
66
67         equal( changeCount, 1, "change fired only once (no jitters) when dragging a floated sortable in it's own container" );
68
69         element.simulate( "drag", {
70                 dx: 50,
71                 moves: 15
72         });
73
74         equal( changeCount, 3, "change fired once for each expected change when dragging a floated sortable to a connected container" );
75 });
76
77 /*
78 test("{ connectWith: false }, default", function() {
79         ok(false, "missing test - untested code is broken code.");
80 });
81
82 test("{ connectWith: Selector }", function() {
83         ok(false, "missing test - untested code is broken code.");
84 });
85
86 test("{ containment: false }, default", function() {
87         ok(false, "missing test - untested code is broken code.");
88 });
89
90 test("{ containment: Element }", function() {
91         ok(false, "missing test - untested code is broken code.");
92 });
93
94 test("{ containment: 'document' }", function() {
95         ok(false, "missing test - untested code is broken code.");
96 });
97
98 test("{ containment: 'parent' }", function() {
99         ok(false, "missing test - untested code is broken code.");
100 });
101
102 test("{ containment: 'window' }", function() {
103         ok(false, "missing test - untested code is broken code.");
104 });
105
106 test("{ containment: Selector }", function() {
107         ok(false, "missing test - untested code is broken code.");
108 });
109
110 test("{ cursor: 'auto' }, default", function() {
111         ok(false, "missing test - untested code is broken code.");
112 });
113
114 test("{ cursor: 'move' }", function() {
115         ok(false, "missing test - untested code is broken code.");
116 });
117
118 test("{ cursorAt: false }, default", function() {
119         ok(false, "missing test - untested code is broken code.");
120 });
121
122 test("{ cursorAt: true }", function() {
123         ok(false, "missing test - untested code is broken code.");
124 });
125
126 test("{ delay: 0 }, default", function() {
127         ok(false, "missing test - untested code is broken code.");
128 });
129
130 test("{ delay: 100 }", function() {
131         ok(false, "missing test - untested code is broken code.");
132 });
133
134 test("{ distance: 1 }, default", function() {
135         ok(false, "missing test - untested code is broken code.");
136 });
137
138 test("{ distance: 10 }", function() {
139         ok(false, "missing test - untested code is broken code.");
140 });
141
142 test("{ dropOnEmpty: true }, default", function() {
143         ok(false, "missing test - untested code is broken code.");
144 });
145
146 test("{ dropOnEmpty: false }", function() {
147         ok(false, "missing test - untested code is broken code.");
148 });
149
150 test("{ forcePlaceholderSize: false }, default", function() {
151         ok(false, "missing test - untested code is broken code.");
152 });
153
154 test("{ forcePlaceholderSize: true }", function() {
155         ok(false, "missing test - untested code is broken code.");
156 });
157
158 test("{ forceHelperSize: false }, default", function() {
159         ok(false, "missing test - untested code is broken code.");
160 });
161
162 test("{ forceHelperSize: true }", function() {
163         ok(false, "missing test - untested code is broken code.");
164 });
165
166 test("{ grid: false }, default", function() {
167         ok(false, "missing test - untested code is broken code.");
168 });
169
170 test("{ grid: [17, 3] }", function() {
171         ok(false, "missing test - untested code is broken code.");
172 });
173
174 test("{ grid: [3, 7] }", function() {
175         ok(false, "missing test - untested code is broken code.");
176 });
177
178 test("{ handle: false }, default", function() {
179         ok(false, "missing test - untested code is broken code.");
180 });
181
182 test("{ handle: Element }", function() {
183         ok(false, "missing test - untested code is broken code.");
184 });
185
186 test("{ handle: Selector }", function() {
187         ok(false, "missing test - untested code is broken code.");
188 });
189
190 test("{ helper: 'original' }, default", function() {
191         ok(false, "missing test - untested code is broken code.");
192 });
193
194 test("{ helper: Function }", function() {
195         ok(false, "missing test - untested code is broken code.");
196 });
197
198 test("{ items: '> *' }, default", function() {
199         ok(false, "missing test - untested code is broken code.");
200 });
201
202 test("{ items: Selector }", function() {
203         ok(false, "missing test - untested code is broken code.");
204 });
205
206 test("{ opacity: false }, default", function() {
207         ok(false, "missing test - untested code is broken code.");
208 });
209
210 test("{ opacity: .37 }", function() {
211         ok(false, "missing test - untested code is broken code.");
212 });
213
214 test("{ opacity: 1 }", function() {
215         ok(false, "missing test - untested code is broken code.");
216 });
217
218 test("{ placeholder: false }, default", function() {
219         ok(false, "missing test - untested code is broken code.");
220 });
221 */
222
223 test( "{ placeholder: false } img", function() {
224         expect( 3 );
225
226         var element = $( "#sortable-images" ).sortable({
227                 start: function( event, ui ) {
228                         equal( ui.placeholder.attr( "src" ), "../images/jqueryui_32x32.png", "placeholder img has correct src" );
229                         equal( ui.placeholder.height(), 32, "placeholder has correct height" );
230                         equal( ui.placeholder.width(), 32, "placeholder has correct width" );
231                 }
232         });
233
234         element.find( "img" ).eq( 0 ).simulate( "drag", {
235                 dy: 1
236         });
237 });
238
239 test( "{ placeholder: String }", function() {
240         expect( 1 );
241
242         var element = $( "#sortable" ).sortable({
243                 placeholder: "test",
244                 start: function( event, ui ) {
245                         ok( ui.placeholder.hasClass( "test" ), "placeholder has class" );
246                 }
247         });
248
249         element.find( "li" ).eq( 0 ).simulate( "drag", {
250                 dy: 1
251         });
252 });
253
254 test( "{ placholder: String } tr", function() {
255         expect( 3 );
256
257         var element = $( "#sortable-table tbody" ).sortable({
258                 placeholder: "test",
259                 start: function( event, ui ) {
260                         ok( ui.placeholder.hasClass( "test" ), "placeholder has class" );
261                         equal( ui.placeholder.children().length, 1, "placeholder tr contains a td" );
262                         equal( ui.placeholder.children().html(), $( "<span>&#160;</span>" ).html(),
263                                 "placeholder td has content for forced dimensions" );
264                 }
265         });
266
267         element.find( "tr" ).eq( 0 ).simulate( "drag", {
268                 dy: 1
269         });
270 });
271
272 /*
273 test("{ revert: false }, default", function() {
274         ok(false, "missing test - untested code is broken code.");
275 });
276
277 test("{ revert: true }", function() {
278         ok(false, "missing test - untested code is broken code.");
279 });
280
281 test("{ scroll: true }, default", function() {
282         ok(false, "missing test - untested code is broken code.");
283 });
284
285 test("{ scroll: false }", function() {
286         ok(false, "missing test - untested code is broken code.");
287 });
288
289 test("{ scrollSensitivity: 20 }, default", function() {
290         ok(false, "missing test - untested code is broken code.");
291 });
292
293 test("{ scrollSensitivity: 2 }", function() {
294         ok(false, "missing test - untested code is broken code.");
295 });
296
297 test("{ scrollSensitivity: 200 }", function() {
298         ok(false, "missing test - untested code is broken code.");
299 });
300
301 test("{ scrollSpeed: 20 }, default", function() {
302         ok(false, "missing test - untested code is broken code.");
303 });
304
305 test("{ scrollSpeed: 2 }", function() {
306         ok(false, "missing test - untested code is broken code.");
307 });
308
309 test("{ scrollSpeed: 200 }", function() {
310         ok(false, "missing test - untested code is broken code.");
311 });
312
313 test("{ scope: 'default' }, default", function() {
314         ok(false, "missing test - untested code is broken code.");
315 });
316
317 test("{ scope: ??? }, unexpected", function() {
318         ok(false, "missing test - untested code is broken code.");
319 });
320
321 test("{ tolerance: 'intersect' }, default", function() {
322         ok(false, "missing test - untested code is broken code.");
323 });
324
325 test("{ tolerance: 'pointer' }", function() {
326         ok(false, "missing test - untested code is broken code.");
327 });
328
329 test("{ zIndex: 1000 }, default", function() {
330         ok(false, "missing test - untested code is broken code.");
331 });
332
333 test("{ zIndex: 1 }", function() {
334         ok(false, "missing test - untested code is broken code.");
335 });
336
337 test("{ zIndex: false }", function() {
338         ok(false, "missing test - untested code is broken code.");
339 });
340 */
341 })(jQuery);