mirror of
https://github.com/jquery/jquery-ui.git
synced 2024-11-21 11:04:24 +00:00
28 lines
554 B
JavaScript
28 lines
554 B
JavaScript
|
/*
|
||
|
* 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);
|