aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorMike Sherov <mike.sherov@gmail.com>2013-03-26 09:18:00 -0400
committerScott González <scott.gonzalez@gmail.com>2013-04-17 14:52:20 -0400
commit59028995d071b2eb5910ffcc2e5708835d1a2887 (patch)
tree1530965fd39f80b7ed6fec127528ad2b70b843bd /tests
parentf8e76d0bbdd9b4fd213a0e3f716906d9c287f612 (diff)
downloadjquery-ui-59028995d071b2eb5910ffcc2e5708835d1a2887.tar.gz
jquery-ui-59028995d071b2eb5910ffcc2e5708835d1a2887.zip
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)
Diffstat (limited to 'tests')
-rw-r--r--tests/unit/draggable/draggable_core.js20
1 files changed, 20 insertions, 0 deletions
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( "<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 );