From: Mike Sherov Date: Tue, 26 Mar 2013 13:18:00 +0000 (-0400) Subject: Draggable Tests: Test that removing an element on drop doesn't cause a draggable... X-Git-Tag: 1.10.3~45 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=59028995d071b2eb5910ffcc2e5708835d1a2887;p=jquery-ui.git Draggable Tests: Test that removing an element on drop doesn't cause a draggable error. Fixes #9159 - Draggable Tests: Write test case for #8269 (cherry picked from commit e9faec96ed0152a4943efa838b9025d63e3e3093) --- diff --git a/tests/unit/draggable/draggable_core.js b/tests/unit/draggable/draggable_core.js index 2090f2fd9..ab63c3703 100644 --- a/tests/unit/draggable/draggable_core.js +++ b/tests/unit/draggable/draggable_core.js @@ -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( "
" ).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 );