Permalink
Browse files

Draggable Tests: Test that removing an element on drop doesn't cause …

…a draggable error. Fixes #9159 - Draggable Tests: Write test case for #8269
  • Loading branch information...
mikesherov committed Mar 26, 2013
1 parent 53c88a7 commit e9faec96ed0152a4943efa838b9025d63e3e3093
Showing with 20 additions and 0 deletions.
  1. +20 −0 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( "<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 );

0 comments on commit e9faec9

Please sign in to comment.