]> source.dussan.org Git - jquery-ui.git/commitdiff
Draggable Tests: Test that removing an element on drop doesn't cause a draggable...
authorMike Sherov <mike.sherov@gmail.com>
Tue, 26 Mar 2013 13:18:00 +0000 (09:18 -0400)
committerScott González <scott.gonzalez@gmail.com>
Wed, 17 Apr 2013 18:52:20 +0000 (14:52 -0400)
(cherry picked from commit e9faec96ed0152a4943efa838b9025d63e3e3093)

tests/unit/draggable/draggable_core.js

index 2090f2fd9ad8ec0701548e2c3075c59106259d73..ab63c3703894ff521a83118bd46d9f9d82b80240 100644 (file)
@@ -85,4 +85,24 @@ test( "resizable handle with complex markup (#8756 / #8757)", function() {
        equal( target.width(), 200, "compare width" );
 });
 
+test( "#8269: Removing draggable element on drop", function() {
+       expect( 1 );
+
+       var element = $( "#draggable1" ).wrap( "<div id='wrapper' />" ).draggable(),
+               dropOffset = $( "#droppable" ).offset();
+
+       $( "#droppable" ).droppable({
+               drop: function() {
+                       $( "#wrapper" ).remove();
+                       ok( true, "element removed from DOM on drop" );
+               }
+       });
+
+       element.simulate( "drag", {
+               handle: "corner",
+               x: dropOffset.left,
+               y: dropOffset.top
+       });
+});
+
 })( jQuery );