aboutsummaryrefslogtreecommitdiffstats
path: root/tests/unit/draggable/draggable_options.js
diff options
context:
space:
mode:
authorJörn Zaefferer <joern.zaefferer@gmail.com>2012-02-28 15:56:32 +0100
committerJörn Zaefferer <joern.zaefferer@gmail.com>2012-02-29 18:36:40 +0100
commit72023dd045a7fead5a3136ec2400ad4743a190d2 (patch)
tree4999a287a815e6a4200498a2a0241abc349fe599 /tests/unit/draggable/draggable_options.js
parente6b7486abf2e0f98837e76027084fad6fe908cff (diff)
downloadjquery-ui-72023dd045a7fead5a3136ec2400ad4743a190d2.tar.gz
jquery-ui-72023dd045a7fead5a3136ec2400ad4743a190d2.zip
Update to QUnit 1.3. Replace usage of same with deepEqual and equals with equal.
Diffstat (limited to 'tests/unit/draggable/draggable_options.js')
-rw-r--r--tests/unit/draggable/draggable_options.js148
1 files changed, 74 insertions, 74 deletions
diff --git a/tests/unit/draggable/draggable_options.js b/tests/unit/draggable/draggable_options.js
index 8ba77fb93..d5f85feab 100644
--- a/tests/unit/draggable/draggable_options.js
+++ b/tests/unit/draggable/draggable_options.js
@@ -24,7 +24,7 @@ var margin = function(el, side) { return parseInt(el.css('margin-' + side)); }
module("draggable: options");
test("{ addClasses: true }, default", function() {
- equals(draggable_defaults.addClasses, true);
+ equal(draggable_defaults.addClasses, true);
el = $("<div></div>").draggable({ addClasses: true });
ok(el.is(".ui-draggable"), "'ui-draggable' class added");
@@ -40,12 +40,12 @@ test("{ addClasses: false }", function() {
});
test("{ appendTo: 'parent' }, default", function() {
- equals(draggable_defaults.appendTo, "parent");
+ equal(draggable_defaults.appendTo, "parent");
el = $("#draggable2").draggable({ appendTo: 'parent' });
drag(el, 50, 50);
moved(50, 50);
-
+
el = $("#draggable1").draggable({ appendTo: 'parent' });
drag(el, 50, 50);
moved(50, 50);
@@ -56,7 +56,7 @@ test("{ appendTo: Element }", function() {
el = $("#draggable2").draggable({ appendTo: $("#draggable2").parent()[0] });
drag(el, 50, 50);
moved(50, 50);
-
+
el = $("#draggable1").draggable({ appendTo: $("#draggable2").parent()[0] });
drag(el, 50, 50);
moved(50, 50);
@@ -66,14 +66,14 @@ test("{ appendTo: Selector }", function() {
el = $("#draggable2").draggable({ appendTo: "#main" });
drag(el, 50, 50);
moved(50, 50);
-
+
el = $("#draggable1").draggable({ appendTo: "#main" });
drag(el, 50, 50);
moved(50, 50);
});
test("{ axis: false }, default", function() {
- equals(draggable_defaults.axis, false);
+ equal(draggable_defaults.axis, false);
el = $("#draggable2").draggable({ axis: false });
drag(el, 50, 50);
@@ -110,7 +110,7 @@ test("{ axis: ? }, unexpected", function() {
});
test("{ cancel: ':input,option' }, default", function() {
- equals(draggable_defaults.cancel, ":input,option");
+ equal(draggable_defaults.cancel, ":input,option");
$('<div id="draggable-option-cancel-default"><input type="text"></div>').appendTo('#main');
@@ -159,7 +159,7 @@ test("{ cancel: ? }, unexpected", function() {
});
test("{ containment: false }, default", function() {
- equals(draggable_defaults.containment, false);
+ equal(draggable_defaults.containment, false);
ok(false, 'missing test - untested code is broken code');
});
@@ -176,7 +176,7 @@ test("{ containment: 'parent' }, relative", function() {
left: po.left + border(p, 'left') + margin(el, 'left'),
top: po.top + border(p, 'top') + margin(el, 'top')
}
- same(offsetAfter, expected, 'compare offset to parent');
+ deepEqual(offsetAfter, expected, 'compare offset to parent');
});
test("{ containment: 'parent' }, absolute", function() {
@@ -187,7 +187,7 @@ test("{ containment: 'parent' }, absolute", function() {
left: po.left + border(p, 'left') + margin(el, 'left'),
top: po.top + border(p, 'top') + margin(el, 'top')
}
- same(offsetAfter, expected, 'compare offset to parent');
+ deepEqual(offsetAfter, expected, 'compare offset to parent');
});
test("{ containment: 'document' }", function() {
@@ -207,7 +207,7 @@ test("{ containment: [x1, y1, x2, y2] }", function() {
});
test("{ cursor: 'auto' }, default", function() {
- equals(draggable_defaults.cursor, 'auto');
+ equal(draggable_defaults.cursor, 'auto');
function getCursor() { return $("#draggable2").css("cursor"); }
@@ -226,8 +226,8 @@ test("{ cursor: 'auto' }, default", function() {
drag("#draggable2", -1, -1);
after = getCursor();
- equals(actual, expected, "start callback: cursor '" + expected + "'");
- equals(after, before, "after drag: cursor restored");
+ equal(actual, expected, "start callback: cursor '" + expected + "'");
+ equal(after, before, "after drag: cursor restored");
});
@@ -250,13 +250,13 @@ test("{ cursor: 'move' }", function() {
drag("#draggable2", -1, -1);
after = getCursor();
- equals(actual, expected, "start callback: cursor '" + expected + "'");
- equals(after, before, "after drag: cursor restored");
+ equal(actual, expected, "start callback: cursor '" + expected + "'");
+ equal(after, before, "after drag: cursor restored");
});
test("{ cursorAt: false}, default", function() {
- equals(draggable_defaults.cursorAt, false);
+ equal(draggable_defaults.cursorAt, false);
ok(false, 'missing test - untested code is broken code');
});
@@ -272,8 +272,8 @@ test("{ cursorAt: { left: -5, top: -5 } }", function() {
var el = $('#draggable' + (i + 1)).draggable({
cursorAt: { left: cursorAtX, top: cursorAtY },
drag: function(event, ui) {
- equals(ui.offset.left, expected.left, position + ' left');
- equals(ui.offset.top, expected.top, position + ' top');
+ equal(ui.offset.left, expected.left, position + ' left');
+ equal(ui.offset.top, expected.top, position + ' top');
}
}),
before = el.offset(),
@@ -305,8 +305,8 @@ test("{ cursorAt: { right: 10, bottom: 20 } }", function() {
var el = $('#draggable' + (i + 1)).draggable({
cursorAt: { right: cursorAtX, bottom: cursorAtY },
drag: function(event, ui) {
- equals(ui.offset.left, expected.left, position + ' left');
- equals(ui.offset.top, expected.top, position + ' top');
+ equal(ui.offset.left, expected.left, position + ' left');
+ equal(ui.offset.top, expected.top, position + ' top');
}
}),
before = el.offset(),
@@ -338,8 +338,8 @@ test("{ cursorAt: [10, 20] }", function() {
var el = $('#draggable' + (i + 1)).draggable({
cursorAt: { left: cursorAtX, top: cursorAtY },
drag: function(event, ui) {
- equals(ui.offset.left, expected.left, position + ' left');
- equals(ui.offset.top, expected.top, position + ' top');
+ equal(ui.offset.left, expected.left, position + ' left');
+ equal(ui.offset.top, expected.top, position + ' top');
}
}),
before = el.offset(),
@@ -371,8 +371,8 @@ test("{ cursorAt: '20, 40' }", function() {
var el = $('#draggable' + (i + 1)).draggable({
cursorAt: { left: cursorAtX, top: cursorAtY },
drag: function(event, ui) {
- equals(ui.offset.left, expected.left, position + ' left');
- equals(ui.offset.top, expected.top, position + ' top');
+ equal(ui.offset.left, expected.left, position + ' left');
+ equal(ui.offset.top, expected.top, position + ' top');
}
}),
before = el.offset(),
@@ -446,58 +446,58 @@ test("{ helper: 'clone' }, absolute", function() {
});
test("{ helper: 'original' }, relative, with scroll offset on parent", function() {
-
+
el = $("#draggable1").draggable({ helper: "original" });
setScroll();
testScroll('relative');
-
+
setScroll();
testScroll('static');
-
+
setScroll();
testScroll('absolute');
restoreScroll();
-
+
});
test("{ helper: 'original' }, relative, with scroll offset on root", function() {
-
+
el = $("#draggable1").draggable({ helper: "original" });
-
+
setScroll('root');
testScroll('relative');
-
+
setScroll('root');
testScroll('static');
-
+
setScroll('root');
testScroll('absolute');
restoreScroll('root');
-
+
});
test("{ helper: 'original' }, relative, with scroll offset on root and parent", function() {
-
+
el = $("#draggable1").draggable({ helper: "original" });
-
+
setScroll();
setScroll('root');
testScroll('relative');
-
+
setScroll();
setScroll('root');
testScroll('static');
-
+
setScroll();
setScroll('root');
testScroll('absolute');
restoreScroll();
restoreScroll('root');
-
+
});
test("{ helper: 'original' }, absolute, with scroll offset on parent", function() {
@@ -506,10 +506,10 @@ test("{ helper: 'original' }, absolute, with scroll offset on parent", function(
setScroll();
testScroll('relative');
-
+
setScroll();
testScroll('static');
-
+
setScroll();
testScroll('absolute');
@@ -520,18 +520,18 @@ test("{ helper: 'original' }, absolute, with scroll offset on parent", function(
test("{ helper: 'original' }, absolute, with scroll offset on root", function() {
el = $("#draggable1").css({ position: 'absolute', top: 0, left: 0 }).draggable({ helper: "original" });
-
+
setScroll('root');
testScroll('relative');
-
+
setScroll('root');
testScroll('static');
-
+
setScroll('root');
testScroll('absolute');
restoreScroll('root');
-
+
});
test("{ helper: 'original' }, absolute, with scroll offset on root and parent", function() {
@@ -541,18 +541,18 @@ test("{ helper: 'original' }, absolute, with scroll offset on root and parent",
setScroll();
setScroll('root');
testScroll('relative');
-
+
setScroll();
setScroll('root');
testScroll('static');
-
+
setScroll();
setScroll('root');
testScroll('absolute');
restoreScroll();
restoreScroll('root');
-
+
});
test("{ helper: 'original' }, fixed, with scroll offset on parent", function() {
@@ -561,10 +561,10 @@ test("{ helper: 'original' }, fixed, with scroll offset on parent", function() {
setScroll();
testScroll('relative');
-
+
setScroll();
testScroll('static');
-
+
setScroll();
testScroll('absolute');
@@ -573,15 +573,15 @@ test("{ helper: 'original' }, fixed, with scroll offset on parent", function() {
});
test("{ helper: 'original' }, fixed, with scroll offset on root", function() {
-
+
el = $("#draggable1").css({ position: 'fixed', top: 0, left: 0 }).draggable({ helper: "original" });
setScroll('root');
testScroll('relative');
-
+
setScroll('root');
testScroll('static');
-
+
setScroll('root');
testScroll('absolute');
@@ -595,15 +595,15 @@ test("{ helper: 'original' }, fixed, with scroll offset on root and parent", fun
setScroll();
setScroll('root');
testScroll('relative');
-
+
setScroll();
setScroll('root');
testScroll('static');
-
+
setScroll();
setScroll('root');
testScroll('absolute');
-
+
restoreScroll();
restoreScroll('root');
@@ -619,7 +619,7 @@ test("{ helper: 'clone' }, absolute", function() {
} });
drag(el, 1, 1);
- same({ top: helperOffset.top-1, left: helperOffset.left-1 }, origOffset, 'dragged[' + dragged.dx + ', ' + dragged.dy + '] ');
+ deepEqual({ top: helperOffset.top-1, left: helperOffset.left-1 }, origOffset, 'dragged[' + dragged.dx + ', ' + dragged.dy + '] ');
});
@@ -636,18 +636,18 @@ test("{ helper: 'clone' }, absolute with scroll offset on parent", function() {
$("#main").css('position', 'relative');
origOffset = $("#draggable1").offset();
drag(el, 1, 1);
- same({ top: helperOffset.top-1, left: helperOffset.left-1 }, origOffset, 'dragged[' + dragged.dx + ', ' + dragged.dy + '] ');
+ deepEqual({ top: helperOffset.top-1, left: helperOffset.left-1 }, origOffset, 'dragged[' + dragged.dx + ', ' + dragged.dy + '] ');
$("#main").css('position', 'static');
origOffset = $("#draggable1").offset();
drag(el, 1, 1);
- same({ top: helperOffset.top-1, left: helperOffset.left-1 }, origOffset, 'dragged[' + dragged.dx + ', ' + dragged.dy + '] ');
-
+ deepEqual({ top: helperOffset.top-1, left: helperOffset.left-1 }, origOffset, 'dragged[' + dragged.dx + ', ' + dragged.dy + '] ');
+
$("#main").css('position', 'absolute');
origOffset = $("#draggable1").offset();
drag(el, 1, 1);
- same({ top: helperOffset.top-1, left: helperOffset.left-1 }, origOffset, 'dragged[' + dragged.dx + ', ' + dragged.dy + '] ');
-
+ deepEqual({ top: helperOffset.top-1, left: helperOffset.left-1 }, origOffset, 'dragged[' + dragged.dx + ', ' + dragged.dy + '] ');
+
restoreScroll();
});
@@ -661,22 +661,22 @@ test("{ helper: 'clone' }, absolute with scroll offset on root", function() {
el = $("#draggable1").draggable({ helper: "clone", drag: function(event, ui) {
helperOffset = ui.helper.offset();
} });
-
+
$("#main").css('position', 'relative');
origOffset = $("#draggable1").offset();
drag(el, 1, 1);
- same({ top: helperOffset.top-1, left: helperOffset.left-1 }, origOffset, 'dragged[' + dragged.dx + ', ' + dragged.dy + '] ');
+ deepEqual({ top: helperOffset.top-1, left: helperOffset.left-1 }, origOffset, 'dragged[' + dragged.dx + ', ' + dragged.dy + '] ');
$("#main").css('position', 'static');
origOffset = $("#draggable1").offset();
drag(el, 1, 1);
- same({ top: helperOffset.top-1, left: helperOffset.left-1 }, origOffset, 'dragged[' + dragged.dx + ', ' + dragged.dy + '] ');
-
+ deepEqual({ top: helperOffset.top-1, left: helperOffset.left-1 }, origOffset, 'dragged[' + dragged.dx + ', ' + dragged.dy + '] ');
+
$("#main").css('position', 'absolute');
origOffset = $("#draggable1").offset();
drag(el, 1, 1);
- same({ top: helperOffset.top-1, left: helperOffset.left-1 }, origOffset, 'dragged[' + dragged.dx + ', ' + dragged.dy + '] ');
-
+ deepEqual({ top: helperOffset.top-1, left: helperOffset.left-1 }, origOffset, 'dragged[' + dragged.dx + ', ' + dragged.dy + '] ');
+
restoreScroll('root');
});
@@ -695,18 +695,18 @@ test("{ helper: 'clone' }, absolute with scroll offset on root and parent", func
$("#main").css('position', 'relative');
origOffset = $("#draggable1").offset()
drag(el, 1, 1);
- same({ top: helperOffset.top-1, left: helperOffset.left-1 }, origOffset, 'dragged[' + dragged.dx + ', ' + dragged.dy + '] ');
+ deepEqual({ top: helperOffset.top-1, left: helperOffset.left-1 }, origOffset, 'dragged[' + dragged.dx + ', ' + dragged.dy + '] ');
$("#main").css('position', 'static');
origOffset = $("#draggable1").offset()
drag(el, 1, 1);
- same({ top: helperOffset.top-1, left: helperOffset.left-1 }, origOffset, 'dragged[' + dragged.dx + ', ' + dragged.dy + '] ');
-
+ deepEqual({ top: helperOffset.top-1, left: helperOffset.left-1 }, origOffset, 'dragged[' + dragged.dx + ', ' + dragged.dy + '] ');
+
$("#main").css('position', 'absolute');
origOffset = $("#draggable1").offset()
drag(el, 1, 1);
- same({ top: helperOffset.top-1, left: helperOffset.left-1 }, origOffset, 'dragged[' + dragged.dx + ', ' + dragged.dy + '] ');
-
+ deepEqual({ top: helperOffset.top-1, left: helperOffset.left-1 }, origOffset, 'dragged[' + dragged.dx + ', ' + dragged.dy + '] ');
+
restoreScroll('root');
restoreScroll();
@@ -726,7 +726,7 @@ test("{ opacity: 0.5 }", function() {
drag("#draggable2", -1, -1);
- equals(opacity, 0.5, "start callback: opacity is");
+ equal(opacity, 0.5, "start callback: opacity is");
});
@@ -746,7 +746,7 @@ test("{ zIndex: 10 }", function() {
drag("#draggable2", -1, -1);
- equals(actual, expected, "start callback: zIndex is");
+ equal(actual, expected, "start callback: zIndex is");
});