imported the whole jquery-ui package, refreshed with 1.10.2
[myslice.git] / third-party / jquery-ui-1.10.2 / tests / unit / droppable / droppable_events.js
1 (function( $ ) {
2
3 module( "droppable: events" );
4
5 test( "droppable destruction/recreation on drop event", function() {
6         expect( 1 );
7
8         var config = {
9                         activeClass: "active",
10                         drop: function() {
11                                 var element = $( this ),
12                                         newDroppable = $( "<div>" )
13                                                 .css({ width: 100, height: 100 })
14                                                 .text( "Droppable" );
15                                 element.after( newDroppable );
16                                 element.remove();
17                                 newDroppable.droppable( config );
18                         }
19                 },
20
21                 draggable = $( "#draggable1" ).draggable(),
22                 droppable1 = $( "#droppable1" ).droppable( config ),
23                 droppable2 = $( "#droppable2" ).droppable( config ),
24
25                 droppableOffset = droppable1.offset(),
26                 draggableOffset = draggable.offset(),
27                 dx = droppableOffset.left - draggableOffset.left,
28                 dy = droppableOffset.top - draggableOffset.top;
29
30         draggable.simulate( "drag", {
31                 dx: dx,
32                 dy: dy
33         });
34
35         ok( !droppable2.hasClass( "active" ), "subsequent droppable no longer active" );
36 });
37
38
39
40 // todo: comment the following in when ready to actually test
41 /*
42 test("activate", function() {
43         ok(false, 'missing test - untested code is broken code');
44 });
45
46 test("deactivate", function() {
47         ok(false, 'missing test - untested code is broken code');
48 });
49
50 test("over", function() {
51         ok(false, 'missing test - untested code is broken code');
52 });
53
54 test("out", function() {
55         ok(false, 'missing test - untested code is broken code');
56 });
57
58 test("drop", function() {
59         ok(false, 'missing test - untested code is broken code');
60 });
61 */
62
63 })( jQuery );