aboutsummaryrefslogtreecommitdiffstats
path: root/tests/unit/draggable/draggable_events.js
blob: 79b406e8c07a7ec2c2097ebade5b9113cc92e2a0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
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);