started event.special.scrollstart.setup tests

This commit is contained in:
John Bender 2010-11-30 22:56:43 -08:00
parent c27122040a
commit b2905ee08c

View file

@ -12,6 +12,8 @@
$.each(events, function(i, name){
$("#main").unbind(name);
});
$($.event.special.scrollstart).unbind("scrollstart");
}
});
@ -55,4 +57,32 @@
ok($.attrFn[name]);
});
});
test( "scrollstart enabled defaults to true", function(){
$.event.special.scrollstart.enabled = false;
$.testHelper.reloadLib(libName);
ok($.event.special.scrollstart.enabled);
});
test( "scrollstart setup binds a function that returns when its disabled", function(){
expect( 0 );
$.event.special.scrollstart.enabled = false;
$($.event.special.scrollstart).bind("scrollstart", function(){
ok(false);
});
console.log("foo");
$($.event.special.scrollstart).trigger("touchmove");
});
test( "scrollstart setup binds a function that triggers scroll start when enabled", function(){
$.event.special.scrollstart.enabled = true;
$($.event.special.scrollstart).bind("scrollstart", function(){
ok(true);
});
$($.event.special.scrollstart).trigger("touchmove");
});
})(jQuery);