aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Worth <rdworth@gmail.com>2008-09-27 16:10:43 +0000
committerRichard Worth <rdworth@gmail.com>2008-09-27 16:10:43 +0000
commit2b0cb8c231334e845066b28face27634cac8bc4b (patch)
tree8c70393edbc411e78151c7bb6a85377b6288a21b
parent37d14b7f074553f509800c7c8fe25defe166e161 (diff)
downloadjquery-ui-2b0cb8c231334e845066b28face27634cac8bc4b.tar.gz
jquery-ui-2b0cb8c231334e845066b28face27634cac8bc4b.zip
Updated draggable defaults unit test
-rw-r--r--tests/draggable.js42
1 files changed, 35 insertions, 7 deletions
diff --git a/tests/draggable.js b/tests/draggable.js
index 6045d00f2..59b31a0cc 100644
--- a/tests/draggable.js
+++ b/tests/draggable.js
@@ -138,14 +138,42 @@ test("element types", function() {
});
test("defaults", function() {
+
+ var expected = {
+ appendTo: "parent",
+ axis: false,
+ cancel: ":input",
+ connectToSortable: false,
+ containment: "??? - TODO",
+ cursor: "default",
+ cursorAt: null,
+ delay: 0,
+ disabled: false,
+ distance: 1,
+ grid: false,
+ handle: "??? - TODO",
+ helper: "original",
+ iframeFix: false,
+ opacity: 1.0,
+ revert: false,
+ revertDuration: 500,
+ scroll: true,
+ scrollSensitivity: 20,
+ scrollSpeed: 20,
+ scope: "default",
+ snap: false,
+ snapMode: "both",
+ snapTolerance: 20,
+ stack: "??? - TODO",
+ refreshPositions: false,
+ zIndex: null
+ };
+
el = $("#draggable1").draggable();
- equals(el.data("appendTo.draggable"), "parent", "appendTo");
- equals(el.data("axis.draggable"), false, "axis");
- equals(el.data("cancel.draggable"), ":input", "cancel");
- equals(el.data("delay.draggable"), 0, "delay");
- equals(el.data("disabled.draggable"), false, "disabled");
- equals(el.data("distance.draggable"), 1, "distance");
- equals(el.data("helper.draggable"), "original", "helper");
+
+ for (var optionName in expected)
+ equals(el.data(optionName + ".draggable"), expected[optionName], optionName);
+
});
test("No options, relative", function() {