aboutsummaryrefslogtreecommitdiffstats
path: root/tests/unit/draggable/draggable_events.js
diff options
context:
space:
mode:
authorRichard Worth <rdworth@gmail.com>2009-02-01 00:25:58 +0000
committerRichard Worth <rdworth@gmail.com>2009-02-01 00:25:58 +0000
commit79d2a2891aff472b271f23dfc3b3618c906b3d76 (patch)
tree6deb2b984d02f5a3d24de339aed367e9b6ac357b /tests/unit/draggable/draggable_events.js
parent34a5af87791686a1dd64c988361c69b97359196b (diff)
downloadjquery-ui-79d2a2891aff472b271f23dfc3b3618c906b3d76.tar.gz
jquery-ui-79d2a2891aff472b271f23dfc3b3618c906b3d76.zip
draggable unit tests: created separate file for each module: defaults, events, methods, options, tickets
Diffstat (limited to 'tests/unit/draggable/draggable_events.js')
-rw-r--r--tests/unit/draggable/draggable_events.js27
1 files changed, 27 insertions, 0 deletions
diff --git a/tests/unit/draggable/draggable_events.js b/tests/unit/draggable/draggable_events.js
new file mode 100644
index 000000000..79b406e8c
--- /dev/null
+++ b/tests/unit/draggable/draggable_events.js
@@ -0,0 +1,27 @@
+/*
+ * draggable_events.js
+ */
+(function($) {
+
+module("draggable: events");
+
+test("callbacks occurance count", function() {
+
+ expect(3);
+
+ var start = 0, stop = 0, dragc = 0;
+ el = $("#draggable2").draggable({
+ start: function() { start++; },
+ drag: function() { dragc++; },
+ stop: function() { stop++; }
+ });
+
+ drag(el, 10, 10);
+
+ equals(start, 1, "start callback should happen exactly once");
+ equals(dragc, 3, "drag callback should happen exactly once per mousemove");
+ equals(stop, 1, "stop callback should happen exactly once");
+
+});
+
+})(jQuery);