Skip to content
Permalink
Browse files

draggable/resizable: moved in the resizable simulation code to the si…

…ngle resizable test in the draggable testsuite
  • Loading branch information...
MatteS75 committed Nov 14, 2012
1 parent 33f951d commit 3538404ef066182f11a80a18ad0cd3ea6f526f8b
Showing with 11 additions and 18 deletions.
  1. +11 −18 tests/unit/draggable/draggable_core.js
@@ -2,22 +2,6 @@
* draggable_core.js
*/

TestHelpers.resizable = {
drag: function (el, dx, dy, complete) {

// speed = sync -> Drag syncrhonously.
// speed = fast|slow -> Drag asyncrhonously - animated.

//this mouseover is to work around a limitation in resizable
//TODO: fix resizable so handle doesn't require mouseover in order to be used
$(el).simulate("mouseover");

return $(el).simulate("drag", {
dx: dx || 0, dy: dy || 0, speed: 'sync', complete: complete
});
}
};

(function($) {

module("draggable");
@@ -63,6 +47,15 @@ test("No options, absolute", function() {
test("resizable handle with complex markup (#8756 / #8757)", function() {
expect(2);

var drag = function(el, dx) {
$(el)
.simulate("mouseover")
.simulate("drag", {
dx: dx || 0,
speed: 'sync'
});
};

$('#draggable1')
.append(
$('<div>')
@@ -73,10 +66,10 @@ test("resizable handle with complex markup (#8756 / #8757)", function() {

var handle = '.ui-resizable-w div', target = $('#draggable1').draggable().resizable({ handles: 'all' });

TestHelpers.resizable.drag(handle, -50);
drag(handle, -50);
equal( target.width(), 250, "compare width" );

TestHelpers.resizable.drag(handle, 50);
drag(handle, 50);
equal( target.width(), 200, "compare width" );
});

0 comments on commit 3538404

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