Skip to content
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

(cherry picked from commit e9faec9)
  • Loading branch information
mikesherov authored and scottgonzalez committed Apr 17, 2013
1 parent f8e76d0 commit 59028995d071b2eb5910ffcc2e5708835d1a2887
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 5902899

Please sign in to comment.
You can’t perform that action at this time.