mirror of
https://github.com/Hopiu/jquery-mobile.git
synced 2026-04-29 10:24:45 +00:00
started event.special.scrollstart.setup tests
This commit is contained in:
parent
c27122040a
commit
b2905ee08c
1 changed files with 30 additions and 0 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in a new issue