Skip to content
This repository was archived by the owner on Oct 8, 2021. It is now read-only.

Commit b2905ee

Browse files
committed
started event.special.scrollstart.setup tests
1 parent c271220 commit b2905ee

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

tests/unit/event/event_core.js

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
$.each(events, function(i, name){
1313
$("#main").unbind(name);
1414
});
15+
16+
$($.event.special.scrollstart).unbind("scrollstart");
1517
}
1618
});
1719

@@ -55,4 +57,32 @@
5557
ok($.attrFn[name]);
5658
});
5759
});
60+
61+
test( "scrollstart enabled defaults to true", function(){
62+
$.event.special.scrollstart.enabled = false;
63+
$.testHelper.reloadLib(libName);
64+
ok($.event.special.scrollstart.enabled);
65+
});
66+
67+
test( "scrollstart setup binds a function that returns when its disabled", function(){
68+
expect( 0 );
69+
$.event.special.scrollstart.enabled = false;
70+
71+
$($.event.special.scrollstart).bind("scrollstart", function(){
72+
ok(false);
73+
});
74+
75+
console.log("foo");
76+
$($.event.special.scrollstart).trigger("touchmove");
77+
});
78+
79+
test( "scrollstart setup binds a function that triggers scroll start when enabled", function(){
80+
$.event.special.scrollstart.enabled = true;
81+
82+
$($.event.special.scrollstart).bind("scrollstart", function(){
83+
ok(true);
84+
});
85+
86+
$($.event.special.scrollstart).trigger("touchmove");
87+
});
5888
})(jQuery);

0 commit comments

Comments
 (0)