diff options
Diffstat (limited to 'tests/unit/draggable')
-rw-r--r-- | tests/unit/draggable/draggable_core.js | 24 | ||||
-rw-r--r-- | tests/unit/draggable/draggable_events.js | 4 | ||||
-rw-r--r-- | tests/unit/draggable/draggable_methods.js | 54 | ||||
-rw-r--r-- | tests/unit/draggable/draggable_options.js | 208 | ||||
-rw-r--r-- | tests/unit/draggable/draggable_test_helpers.js | 14 |
5 files changed, 152 insertions, 152 deletions
diff --git a/tests/unit/draggable/draggable_core.js b/tests/unit/draggable/draggable_core.js index 2bfccbfa6..00d914194 100644 --- a/tests/unit/draggable/draggable_core.js +++ b/tests/unit/draggable/draggable_core.js @@ -7,20 +7,20 @@ module("draggable"); test("element types", function() { - var typeNames = ('p,h1,h2,h3,h4,h5,h6,blockquote,ol,ul,dl,div,form' + - ',table,fieldset,address,ins,del,em,strong,q,cite,dfn,abbr' + - ',acronym,code,samp,kbd,var,img,hr' + - ',input,button,label,select,iframe').split(','); + var typeNames = ("p,h1,h2,h3,h4,h5,h6,blockquote,ol,ul,dl,div,form" + + ",table,fieldset,address,ins,del,em,strong,q,cite,dfn,abbr" + + ",acronym,code,samp,kbd,var,img,hr" + + ",input,button,label,select,iframe").split(","); expect( typeNames.length * 2 ); $.each(typeNames, function(i) { var offsetBefore, offsetAfter, typeName = typeNames[i], - el = $(document.createElement(typeName)).appendTo('#qunit-fixture'); + el = $(document.createElement(typeName)).appendTo("#qunit-fixture"); - (typeName === 'table' && el.append("<tr><td>content</td></tr>")); - el.draggable({ cancel: '' }); + (typeName === "table" && el.append("<tr><td>content</td></tr>")); + el.draggable({ cancel: "" }); offsetBefore = el.offset(); el.simulate( "drag", { dx: 50, @@ -50,16 +50,16 @@ test("No options, absolute", function() { test("resizable handle with complex markup (#8756 / #8757)", function() { expect( 2 ); - $('#draggable1') + $("#draggable1") .append( - $('<div>') + $("<div>") .addClass("ui-resizable-handle") .addClass("ui-resizable-w") - .append($('<div>')) + .append($("<div>")) ); - var handle = $('.ui-resizable-w div'), - target = $('#draggable1').draggable().resizable({ handles: 'all' }); + var handle = $(".ui-resizable-w div"), + target = $("#draggable1").draggable().resizable({ handles: "all" }); // todo: fix resizable so it doesn't require a mouseover handle.simulate("mouseover").simulate( "drag", { dx: -50 } ); diff --git a/tests/unit/draggable/draggable_events.js b/tests/unit/draggable/draggable_events.js index 07a53e22e..f4ab3a8ea 100644 --- a/tests/unit/draggable/draggable_events.js +++ b/tests/unit/draggable/draggable_events.js @@ -82,7 +82,7 @@ test("stopping the stop callback", function() { expect(1); var el = $("#draggable2").draggable({ - helper: 'clone', + helper: "clone", stop: function() { return false; } }); @@ -91,7 +91,7 @@ test("stopping the stop callback", function() { dy: 10 }); - ok($("#draggable2").data('ui-draggable').helper, "the clone should not be deleted if the stop callback is stopped"); + ok($("#draggable2").data("ui-draggable").helper, "the clone should not be deleted if the stop callback is stopped"); }); diff --git a/tests/unit/draggable/draggable_methods.js b/tests/unit/draggable/draggable_methods.js index 9ea353ca6..43db285ce 100644 --- a/tests/unit/draggable/draggable_methods.js +++ b/tests/unit/draggable/draggable_methods.js @@ -8,36 +8,36 @@ module("draggable: methods"); test("init", function() { expect(5); - $("<div></div>").appendTo('body').draggable().remove(); - ok(true, '.draggable() called on element'); + $("<div></div>").appendTo("body").draggable().remove(); + ok(true, ".draggable() called on element"); $([]).draggable(); - ok(true, '.draggable() called on empty collection'); + ok(true, ".draggable() called on empty collection"); $("<div></div>").draggable(); - ok(true, '.draggable() called on disconnected DOMElement'); + ok(true, ".draggable() called on disconnected DOMElement"); $("<div></div>").draggable().draggable("option", "foo"); - ok(true, 'arbitrary option getter after init'); + ok(true, "arbitrary option getter after init"); $("<div></div>").draggable().draggable("option", "foo", "bar"); - ok(true, 'arbitrary option setter after init'); + ok(true, "arbitrary option setter after init"); }); test("destroy", function() { expect(4); - $("<div></div>").appendTo('body').draggable().draggable("destroy").remove(); - ok(true, '.draggable("destroy") called on element'); + $("<div></div>").appendTo("body").draggable().draggable("destroy").remove(); + ok(true, ".draggable('destroy') called on element"); $([]).draggable().draggable("destroy"); - ok(true, '.draggable("destroy") called on empty collection'); + ok(true, ".draggable('destroy') called on empty collection"); $("<div></div>").draggable().draggable("destroy"); - ok(true, '.draggable("destroy") called on disconnected DOMElement'); + ok(true, ".draggable('destroy') called on disconnected DOMElement"); - var expected = $('<div></div>').draggable(), - actual = expected.draggable('destroy'); - equal(actual, expected, 'destroy is chainable'); + var expected = $("<div></div>").draggable(), + actual = expected.draggable("destroy"); + equal(actual, expected, "destroy is chainable"); }); test("enable", function() { @@ -46,23 +46,23 @@ test("enable", function() { var expected, actual, el; el = $("#draggable2").draggable({ disabled: true }); - TestHelpers.draggable.shouldNotMove(el, '.draggable({ disabled: true })'); + TestHelpers.draggable.shouldNotMove(el, ".draggable({ disabled: true })"); el.draggable("enable"); - TestHelpers.draggable.shouldMove(el, '.draggable("enable")'); + TestHelpers.draggable.shouldMove(el, ".draggable('enable')"); equal(el.draggable("option", "disabled"), false, "disabled option getter"); el.draggable("destroy"); el.draggable({ disabled: true }); - TestHelpers.draggable.shouldNotMove(el, '.draggable({ disabled: true })'); + TestHelpers.draggable.shouldNotMove(el, ".draggable({ disabled: true })"); el.draggable("option", "disabled", false); equal(el.draggable("option", "disabled"), false, "disabled option setter"); - TestHelpers.draggable.shouldMove(el, '.draggable("option", "disabled", false)'); + TestHelpers.draggable.shouldMove(el, ".draggable('option', 'disabled', false)"); - expected = $('<div></div>').draggable(), - actual = expected.draggable('enable'); - equal(actual, expected, 'enable is chainable'); + expected = $("<div></div>").draggable(), + actual = expected.draggable("enable"); + equal(actual, expected, "enable is chainable"); }); test("disable", function() { @@ -71,24 +71,24 @@ test("disable", function() { var expected, actual, el; el = $("#draggable2").draggable({ disabled: false }); - TestHelpers.draggable.shouldMove(el, '.draggable({ disabled: false })'); + TestHelpers.draggable.shouldMove(el, ".draggable({ disabled: false })"); el.draggable("disable"); - TestHelpers.draggable.shouldNotMove(el, '.draggable("disable")'); + TestHelpers.draggable.shouldNotMove(el, ".draggable('disable')"); equal(el.draggable("option", "disabled"), true, "disabled option getter"); el.draggable("destroy"); el.draggable({ disabled: false }); - TestHelpers.draggable.shouldMove(el, '.draggable({ disabled: false })'); + TestHelpers.draggable.shouldMove(el, ".draggable({ disabled: false })"); el.draggable("option", "disabled", true); equal(el.draggable("option", "disabled"), true, "disabled option setter"); - TestHelpers.draggable.shouldNotMove(el, '.draggable("option", "disabled", true)'); + TestHelpers.draggable.shouldNotMove(el, ".draggable('option', 'disabled', true)"); - expected = $('<div></div>').draggable(), - actual = expected.draggable('disable'); - equal(actual, expected, 'disable is chainable'); + expected = $("<div></div>").draggable(), + actual = expected.draggable("disable"); + equal(actual, expected, "disable is chainable"); }); })(jQuery); diff --git a/tests/unit/draggable/draggable_options.js b/tests/unit/draggable/draggable_options.js index 71a0d2f84..46280ca17 100644 --- a/tests/unit/draggable/draggable_options.js +++ b/tests/unit/draggable/draggable_options.js @@ -23,10 +23,10 @@ test("{ addClasses: false }", function() { test("{ appendTo: 'parent' }, default", function() { expect( 2 ); - var el = $("#draggable2").draggable({ appendTo: 'parent' }); + var el = $("#draggable2").draggable({ appendTo: "parent" }); TestHelpers.draggable.shouldMove(el); - el = $("#draggable1").draggable({ appendTo: 'parent' }); + el = $("#draggable1").draggable({ appendTo: "parent" }); TestHelpers.draggable.shouldMove(el); }); @@ -90,7 +90,7 @@ test("{ axis: ? }, unexpected", function() { test("{ cancel: 'input,textarea,button,select,option' }, default", function() { expect( 2 ); - $('<div id="draggable-option-cancel-default"><input type="text"></div>').appendTo('#main'); + $("<div id='draggable-option-cancel-default'><input type='text'></div>").appendTo("#main"); var el = $("#draggable-option-cancel-default").draggable({ cancel: "input,textarea,button,select,option" }); TestHelpers.draggable.shouldMove(el); @@ -110,7 +110,7 @@ test("{ cancel: 'span' }", function() { el.draggable("destroy"); - el = $("#draggable2").draggable({ cancel: 'span' }); + el = $("#draggable2").draggable({ cancel: "span" }); TestHelpers.draggable.testDrag(el, "#draggable2 span", 50, 50, 0, 0); }); @@ -123,7 +123,7 @@ test("{ cancel: ? }, unexpected", function() { "[]": [], "null": null, "undefined": undefined, - "function() {return '';}": function() {return '';}, + "function() {return '';}": function() {return "";}, "function() {return true;}": function() {return true;}, "function() {return false;}": function() {return false;} }; @@ -141,13 +141,13 @@ test("{ cancel: ? }, unexpected", function() { test("{ containment: false }, default", function() { expect( 1 ); - ok(false, 'missing test - untested code is broken code'); + ok(false, "missing test - untested code is broken code"); }); test("{ containment: Element }", function() { expect( 1 ); - ok(false, 'missing test - untested code is broken code'); + ok(false, "missing test - untested code is broken code"); }); */ @@ -155,12 +155,12 @@ test("{ containment: 'parent' }, relative", function() { expect( 1 ); var offsetAfter, - el = $("#draggable1").draggable({ containment: 'parent' }), + el = $("#draggable1").draggable({ containment: "parent" }), p = el.parent(), po = p.offset(), expected = { - left: po.left + TestHelpers.draggable.border(p, 'left') + TestHelpers.draggable.margin(el, 'left'), - top: po.top + TestHelpers.draggable.border(p, 'top') + TestHelpers.draggable.margin(el, 'top') + left: po.left + TestHelpers.draggable.border(p, "left") + TestHelpers.draggable.margin(el, "left"), + top: po.top + TestHelpers.draggable.border(p, "top") + TestHelpers.draggable.margin(el, "top") }; el.simulate( "drag", { @@ -168,19 +168,19 @@ test("{ containment: 'parent' }, relative", function() { dy: -100 }); offsetAfter = el.offset(); - deepEqual(offsetAfter, expected, 'compare offset to parent'); + deepEqual(offsetAfter, expected, "compare offset to parent"); }); test("{ containment: 'parent' }, absolute", function() { expect( 1 ); var offsetAfter, - el = $("#draggable2").draggable({ containment: 'parent' }), + el = $("#draggable2").draggable({ containment: "parent" }), p = el.parent(), po = p.offset(), expected = { - left: po.left + TestHelpers.draggable.border(p, 'left') + TestHelpers.draggable.margin(el, 'left'), - top: po.top + TestHelpers.draggable.border(p, 'top') + TestHelpers.draggable.margin(el, 'top') + left: po.left + TestHelpers.draggable.border(p, "left") + TestHelpers.draggable.margin(el, "left"), + top: po.top + TestHelpers.draggable.border(p, "top") + TestHelpers.draggable.margin(el, "top") }; el.simulate( "drag", { @@ -188,32 +188,32 @@ test("{ containment: 'parent' }, absolute", function() { dy: -100 }); offsetAfter = el.offset(); - deepEqual(offsetAfter, expected, 'compare offset to parent'); + deepEqual(offsetAfter, expected, "compare offset to parent"); }); /* test("{ containment: 'document' }", function() { expect( 1 ); - ok(false, 'missing test - untested code is broken code'); + ok(false, "missing test - untested code is broken code"); }); test("{ containment: 'window' }", function() { expect( 1 ); - ok(false, 'missing test - untested code is broken code'); + ok(false, "missing test - untested code is broken code"); }); test("{ containment: Selector }", function() { expect( 1 ); - ok(false, 'missing test - untested code is broken code'); + ok(false, "missing test - untested code is broken code"); }); test("{ containment: [x1, y1, x2, y2] }", function() { expect( 1 ); - ok(false, 'missing test - untested code is broken code'); + ok(false, "missing test - untested code is broken code"); }); */ @@ -274,7 +274,7 @@ test("{ cursor: 'move' }", function() { test("{ cursorAt: false}, default", function() { expect( 1 ); - ok(false, 'missing test - untested code is broken code'); + ok(false, "missing test - untested code is broken code"); }); */ @@ -318,11 +318,11 @@ test("{ distance: 10 }", function() { expect( 3 ); var el = $("#draggable2").draggable({ distance: 10 }); - TestHelpers.draggable.testDrag(el, el, -9, -9, 0, 0, 'distance not met'); + TestHelpers.draggable.testDrag(el, el, -9, -9, 0, 0, "distance not met"); - TestHelpers.draggable.testDrag(el, el, -10, -10, -10, -10, 'distance met'); + TestHelpers.draggable.testDrag(el, el, -10, -10, -10, -10, "distance met"); - TestHelpers.draggable.testDrag(el, el, 9, 9, 0, 0, 'distance not met'); + TestHelpers.draggable.testDrag(el, el, 9, 9, 0, 0, "distance not met"); }); @@ -345,7 +345,7 @@ test("{ grid: [50, 50] }, absolute", function() { test("{ handle: 'span' }", function() { expect( 2 ); - var el = $("#draggable2").draggable({ handle: 'span' }); + var el = $("#draggable2").draggable({ handle: "span" }); TestHelpers.draggable.testDrag(el, "#draggable2 span", 50, 50, 50, 50, "drag span"); TestHelpers.draggable.shouldNotMove(el, "drag element"); @@ -371,13 +371,13 @@ test("{ helper: 'original' }, relative, with scroll offset on parent", function( var el = $("#draggable1").draggable({ helper: "original" }); TestHelpers.draggable.setScroll(); - TestHelpers.draggable.testScroll(el, 'relative'); + TestHelpers.draggable.testScroll(el, "relative"); TestHelpers.draggable.setScroll(); - TestHelpers.draggable.testScroll(el, 'static'); + TestHelpers.draggable.testScroll(el, "static"); TestHelpers.draggable.setScroll(); - TestHelpers.draggable.testScroll(el, 'absolute'); + TestHelpers.draggable.testScroll(el, "absolute"); TestHelpers.draggable.restoreScroll(); @@ -388,16 +388,16 @@ test("{ helper: 'original' }, relative, with scroll offset on root", function() var el = $("#draggable1").draggable({ helper: "original" }); - TestHelpers.draggable.setScroll('root'); - TestHelpers.draggable.testScroll(el, 'relative'); + TestHelpers.draggable.setScroll("root"); + TestHelpers.draggable.testScroll(el, "relative"); - TestHelpers.draggable.setScroll('root'); - TestHelpers.draggable.testScroll(el, 'static'); + TestHelpers.draggable.setScroll("root"); + TestHelpers.draggable.testScroll(el, "static"); - TestHelpers.draggable.setScroll('root'); - TestHelpers.draggable.testScroll(el, 'absolute'); + TestHelpers.draggable.setScroll("root"); + TestHelpers.draggable.testScroll(el, "absolute"); - TestHelpers.draggable.restoreScroll('root'); + TestHelpers.draggable.restoreScroll("root"); }); @@ -408,19 +408,19 @@ test("{ helper: 'original' }, relative, with scroll offset on root and parent", var el = $("#draggable1").draggable({ helper: "original" }); TestHelpers.draggable.setScroll(); - TestHelpers.draggable.setScroll('root'); - TestHelpers.draggable.testScroll(el, 'relative'); + TestHelpers.draggable.setScroll("root"); + TestHelpers.draggable.testScroll(el, "relative"); TestHelpers.draggable.setScroll(); - TestHelpers.draggable.setScroll('root'); - TestHelpers.draggable.testScroll(el, 'static'); + TestHelpers.draggable.setScroll("root"); + TestHelpers.draggable.testScroll(el, "static"); TestHelpers.draggable.setScroll(); - TestHelpers.draggable.setScroll('root'); - TestHelpers.draggable.testScroll(el, 'absolute'); + TestHelpers.draggable.setScroll("root"); + TestHelpers.draggable.testScroll(el, "absolute"); TestHelpers.draggable.restoreScroll(); - TestHelpers.draggable.restoreScroll('root'); + TestHelpers.draggable.restoreScroll("root"); }); @@ -428,16 +428,16 @@ test("{ helper: 'original' }, absolute, with scroll offset on parent", function( expect(3); - var el = $("#draggable1").css({ position: 'absolute', top: 0, left: 0 }).draggable({ helper: "original" }); + var el = $("#draggable1").css({ position: "absolute", top: 0, left: 0 }).draggable({ helper: "original" }); TestHelpers.draggable.setScroll(); - TestHelpers.draggable.testScroll(el, 'relative'); + TestHelpers.draggable.testScroll(el, "relative"); TestHelpers.draggable.setScroll(); - TestHelpers.draggable.testScroll(el, 'static'); + TestHelpers.draggable.testScroll(el, "static"); TestHelpers.draggable.setScroll(); - TestHelpers.draggable.testScroll(el, 'absolute'); + TestHelpers.draggable.testScroll(el, "absolute"); TestHelpers.draggable.restoreScroll(); @@ -447,18 +447,18 @@ test("{ helper: 'original' }, absolute, with scroll offset on root", function() expect(3); - var el = $("#draggable1").css({ position: 'absolute', top: 0, left: 0 }).draggable({ helper: "original" }); + var el = $("#draggable1").css({ position: "absolute", top: 0, left: 0 }).draggable({ helper: "original" }); - TestHelpers.draggable.setScroll('root'); - TestHelpers.draggable.testScroll(el, 'relative'); + TestHelpers.draggable.setScroll("root"); + TestHelpers.draggable.testScroll(el, "relative"); - TestHelpers.draggable.setScroll('root'); - TestHelpers.draggable.testScroll(el, 'static'); + TestHelpers.draggable.setScroll("root"); + TestHelpers.draggable.testScroll(el, "static"); - TestHelpers.draggable.setScroll('root'); - TestHelpers.draggable.testScroll(el, 'absolute'); + TestHelpers.draggable.setScroll("root"); + TestHelpers.draggable.testScroll(el, "absolute"); - TestHelpers.draggable.restoreScroll('root'); + TestHelpers.draggable.restoreScroll("root"); }); @@ -466,22 +466,22 @@ test("{ helper: 'original' }, absolute, with scroll offset on root and parent", expect(3); - var el = $("#draggable1").css({ position: 'absolute', top: 0, left: 0 }).draggable({ helper: "original" }); + var el = $("#draggable1").css({ position: "absolute", top: 0, left: 0 }).draggable({ helper: "original" }); TestHelpers.draggable.setScroll(); - TestHelpers.draggable.setScroll('root'); - TestHelpers.draggable.testScroll(el, 'relative'); + TestHelpers.draggable.setScroll("root"); + TestHelpers.draggable.testScroll(el, "relative"); TestHelpers.draggable.setScroll(); - TestHelpers.draggable.setScroll('root'); - TestHelpers.draggable.testScroll(el, 'static'); + TestHelpers.draggable.setScroll("root"); + TestHelpers.draggable.testScroll(el, "static"); TestHelpers.draggable.setScroll(); - TestHelpers.draggable.setScroll('root'); - TestHelpers.draggable.testScroll(el, 'absolute'); + TestHelpers.draggable.setScroll("root"); + TestHelpers.draggable.testScroll(el, "absolute"); TestHelpers.draggable.restoreScroll(); - TestHelpers.draggable.restoreScroll('root'); + TestHelpers.draggable.restoreScroll("root"); }); @@ -489,16 +489,16 @@ test("{ helper: 'original' }, fixed, with scroll offset on parent", function() { expect(3); - var el = $("#draggable1").css({ position: 'fixed', top: 0, left: 0 }).draggable({ helper: "original" }); + var el = $("#draggable1").css({ position: "fixed", top: 0, left: 0 }).draggable({ helper: "original" }); TestHelpers.draggable.setScroll(); - TestHelpers.draggable.testScroll(el, 'relative'); + TestHelpers.draggable.testScroll(el, "relative"); TestHelpers.draggable.setScroll(); - TestHelpers.draggable.testScroll(el, 'static'); + TestHelpers.draggable.testScroll(el, "static"); TestHelpers.draggable.setScroll(); - TestHelpers.draggable.testScroll(el, 'absolute'); + TestHelpers.draggable.testScroll(el, "absolute"); TestHelpers.draggable.restoreScroll(); @@ -508,40 +508,40 @@ test("{ helper: 'original' }, fixed, with scroll offset on root", function() { expect(3); - var el = $("#draggable1").css({ position: 'fixed', top: 0, left: 0 }).draggable({ helper: "original" }); + var el = $("#draggable1").css({ position: "fixed", top: 0, left: 0 }).draggable({ helper: "original" }); - TestHelpers.draggable.setScroll('root'); - TestHelpers.draggable.testScroll(el, 'relative'); + TestHelpers.draggable.setScroll("root"); + TestHelpers.draggable.testScroll(el, "relative"); - TestHelpers.draggable.setScroll('root'); - TestHelpers.draggable.testScroll(el, 'static'); + TestHelpers.draggable.setScroll("root"); + TestHelpers.draggable.testScroll(el, "static"); - TestHelpers.draggable.setScroll('root'); - TestHelpers.draggable.testScroll(el, 'absolute'); + TestHelpers.draggable.setScroll("root"); + TestHelpers.draggable.testScroll(el, "absolute"); - TestHelpers.draggable.restoreScroll('root'); + TestHelpers.draggable.restoreScroll("root"); }); test("{ helper: 'original' }, fixed, with scroll offset on root and parent", function() { expect(3); - var el = $("#draggable1").css({ position: 'fixed', top: 0, left: 0 }).draggable({ helper: "original" }); + var el = $("#draggable1").css({ position: "fixed", top: 0, left: 0 }).draggable({ helper: "original" }); TestHelpers.draggable.setScroll(); - TestHelpers.draggable.setScroll('root'); - TestHelpers.draggable.testScroll(el, 'relative'); + TestHelpers.draggable.setScroll("root"); + TestHelpers.draggable.testScroll(el, "relative"); TestHelpers.draggable.setScroll(); - TestHelpers.draggable.setScroll('root'); - TestHelpers.draggable.testScroll(el, 'static'); + TestHelpers.draggable.setScroll("root"); + TestHelpers.draggable.testScroll(el, "static"); TestHelpers.draggable.setScroll(); - TestHelpers.draggable.setScroll('root'); - TestHelpers.draggable.testScroll(el, 'absolute'); + TestHelpers.draggable.setScroll("root"); + TestHelpers.draggable.testScroll(el, "absolute"); TestHelpers.draggable.restoreScroll(); - TestHelpers.draggable.restoreScroll('root'); + TestHelpers.draggable.restoreScroll("root"); }); @@ -559,7 +559,7 @@ test("{ helper: 'clone' }, absolute", function() { dx: 1, dy: 1 }); - deepEqual({ top: helperOffset.top-1, left: helperOffset.left-1 }, origOffset, 'dragged[1, 1] '); + deepEqual({ top: helperOffset.top-1, left: helperOffset.left-1 }, origOffset, "dragged[1, 1] "); }); @@ -574,29 +574,29 @@ test("{ helper: 'clone' }, absolute with scroll offset on parent", function() { helperOffset = ui.helper.offset(); } }); - $("#main").css('position', 'relative'); + $("#main").css("position", "relative"); origOffset = $("#draggable1").offset(); el.simulate( "drag", { dx: 1, dy: 1 }); - deepEqual({ top: helperOffset.top-1, left: helperOffset.left-1 }, origOffset, 'dragged[1, 1] '); + deepEqual({ top: helperOffset.top-1, left: helperOffset.left-1 }, origOffset, "dragged[1, 1] "); - $("#main").css('position', 'static'); + $("#main").css("position", "static"); origOffset = $("#draggable1").offset(); el.simulate( "drag", { dx: 1, dy: 1 }); - deepEqual({ top: helperOffset.top-1, left: helperOffset.left-1 }, origOffset, 'dragged[1, 1] '); + deepEqual({ top: helperOffset.top-1, left: helperOffset.left-1 }, origOffset, "dragged[1, 1] "); - $("#main").css('position', 'absolute'); + $("#main").css("position", "absolute"); origOffset = $("#draggable1").offset(); el.simulate( "drag", { dx: 1, dy: 1 }); - deepEqual({ top: helperOffset.top-1, left: helperOffset.left-1 }, origOffset, 'dragged[1, 1] '); + deepEqual({ top: helperOffset.top-1, left: helperOffset.left-1 }, origOffset, "dragged[1, 1] "); TestHelpers.draggable.restoreScroll(); @@ -606,38 +606,38 @@ test("{ helper: 'clone' }, absolute with scroll offset on root", function() { expect(3); - TestHelpers.draggable.setScroll('root'); + TestHelpers.draggable.setScroll("root"); var helperOffset = null, origOffset = null, el = $("#draggable1").draggable({ helper: "clone", drag: function(event, ui) { helperOffset = ui.helper.offset(); } }); - $("#main").css('position', 'relative'); + $("#main").css("position", "relative"); origOffset = $("#draggable1").offset(); el.simulate( "drag", { dx: 1, dy: 1 }); - deepEqual({ top: helperOffset.top-1, left: helperOffset.left-1 }, origOffset, 'dragged[1, 1] '); + deepEqual({ top: helperOffset.top-1, left: helperOffset.left-1 }, origOffset, "dragged[1, 1] "); - $("#main").css('position', 'static'); + $("#main").css("position", "static"); origOffset = $("#draggable1").offset(); el.simulate( "drag", { dx: 1, dy: 1 }); - deepEqual({ top: helperOffset.top-1, left: helperOffset.left-1 }, origOffset, 'dragged[1, 1] '); + deepEqual({ top: helperOffset.top-1, left: helperOffset.left-1 }, origOffset, "dragged[1, 1] "); - $("#main").css('position', 'absolute'); + $("#main").css("position", "absolute"); origOffset = $("#draggable1").offset(); el.simulate( "drag", { dx: 1, dy: 1 }); - deepEqual({ top: helperOffset.top-1, left: helperOffset.left-1 }, origOffset, 'dragged[1, 1] '); + deepEqual({ top: helperOffset.top-1, left: helperOffset.left-1 }, origOffset, "dragged[1, 1] "); - TestHelpers.draggable.restoreScroll('root'); + TestHelpers.draggable.restoreScroll("root"); }); @@ -645,7 +645,7 @@ test("{ helper: 'clone' }, absolute with scroll offset on root and parent", func expect(3); - TestHelpers.draggable.setScroll('root'); + TestHelpers.draggable.setScroll("root"); TestHelpers.draggable.setScroll(); var helperOffset = null, @@ -654,31 +654,31 @@ test("{ helper: 'clone' }, absolute with scroll offset on root and parent", func helperOffset = ui.helper.offset(); } }); - $("#main").css('position', 'relative'); + $("#main").css("position", "relative"); origOffset = $("#draggable1").offset(); el.simulate( "drag", { dx: 1, dy: 1 }); - deepEqual({ top: helperOffset.top-1, left: helperOffset.left-1 }, origOffset, 'dragged[1, 1] '); + deepEqual({ top: helperOffset.top-1, left: helperOffset.left-1 }, origOffset, "dragged[1, 1] "); - $("#main").css('position', 'static'); + $("#main").css("position", "static"); origOffset = $("#draggable1").offset(); el.simulate( "drag", { dx: 1, dy: 1 }); - deepEqual({ top: helperOffset.top-1, left: helperOffset.left-1 }, origOffset, 'dragged[1, 1] '); + deepEqual({ top: helperOffset.top-1, left: helperOffset.left-1 }, origOffset, "dragged[1, 1] "); - $("#main").css('position', 'absolute'); + $("#main").css("position", "absolute"); origOffset = $("#draggable1").offset(); el.simulate( "drag", { dx: 1, dy: 1 }); - deepEqual({ top: helperOffset.top-1, left: helperOffset.left-1 }, origOffset, 'dragged[1, 1] '); + deepEqual({ top: helperOffset.top-1, left: helperOffset.left-1 }, origOffset, "dragged[1, 1] "); - TestHelpers.draggable.restoreScroll('root'); + TestHelpers.draggable.restoreScroll("root"); TestHelpers.draggable.restoreScroll(); }); diff --git a/tests/unit/draggable/draggable_test_helpers.js b/tests/unit/draggable/draggable_test_helpers.js index 9a6355b2e..c1ac0ab88 100644 --- a/tests/unit/draggable/draggable_test_helpers.js +++ b/tests/unit/draggable/draggable_test_helpers.js @@ -15,7 +15,7 @@ TestHelpers.draggable = { expected = { left: offsetBefore.left + expectedDX, top: offsetBefore.top + expectedDY }; msg = msg ? msg + "." : ""; - deepEqual(actual, expected, 'dragged[' + dx + ', ' + dy + '] ' + msg); + deepEqual(actual, expected, "dragged[" + dx + ", " + dy + "] " + msg); }, shouldMove: function(el, why) { TestHelpers.draggable.testDrag(el, el, 50, 50, 50, 50, why); @@ -24,10 +24,10 @@ TestHelpers.draggable = { TestHelpers.draggable.testDrag(el, el, 50, 50, 0, 0, why); }, testScroll: function(el, position ) { - var oldPosition = $("#main").css('position'); - $("#main").css('position', position); - TestHelpers.draggable.shouldMove(el, position+' parent'); - $("#main").css('position', oldPosition); + var oldPosition = $("#main").css("position"); + $("#main").css("position", position); + TestHelpers.draggable.shouldMove(el, position+" parent"); + $("#main").css("position", oldPosition); }, restoreScroll: function( what ) { if( what ) { @@ -46,9 +46,9 @@ TestHelpers.draggable = { } }, border: function(el, side) { - return parseInt(el.css('border-' + side + '-width'), 10) || 0; + return parseInt(el.css("border-" + side + "-width"), 10) || 0; }, margin: function(el, side) { - return parseInt(el.css('margin-' + side), 10) || 0; + return parseInt(el.css("margin-" + side), 10) || 0; } };
\ No newline at end of file |