8 module( "draggable: events", {
10 element = $("<div>").appendTo("#qunit-fixture");
12 teardown: function() {
13 element.draggable("destroy");
17 test( "callbacks occurrence count", function() {
36 element.simulate( "drag", {
41 equal( start, 1, "start callback should happen exactly once" );
42 equal( dragc, 3, "drag callback should happen exactly once per mousemove" );
43 equal( stop, 1, "stop callback should happen exactly once" );
46 test( "stopping the start callback", function() {
66 element.simulate( "drag", {
71 equal( start, 1, "start callback should happen exactly once" );
72 equal( dragc, 0, "drag callback should not happen at all" );
73 equal( stop, 0, "stop callback should not happen if there wasnt even a start" );
76 test( "stopping the drag callback", function() {
96 element.simulate( "drag", {
101 equal( start, 1, "start callback should happen exactly once" );
102 equal( stop, 1, "stop callback should happen, as we need to actively stop the drag" );
105 test( "stopping the stop callback", function() {
115 element.simulate( "drag", {
120 ok( element.data("ui-draggable").helper, "the clone should not be deleted if the stop callback is stopped" );