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

Commit 5a89066

Browse files
committed
setup function fully tested
1 parent b2905ee commit 5a89066

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

tests/unit/event/event_core.js

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,4 +85,29 @@
8585

8686
$($.event.special.scrollstart).trigger("touchmove");
8787
});
88+
89+
test( "scrollstart setup binds a function that triggers scroll stop after 50 ms", function(){
90+
var triggered = false;
91+
$.event.special.scrollstart.enabled = true;
92+
93+
$($.event.special.scrollstart).bind("scrollstop", function(){
94+
triggered = true;
95+
});
96+
97+
ok(!triggered);
98+
99+
$($.event.special.scrollstart).trigger("touchmove");
100+
101+
stop();
102+
setTimeout(function(){
103+
start();
104+
ok(!triggered);
105+
}, 48);
106+
107+
stop();
108+
setTimeout(function(){
109+
start();
110+
ok(triggered);
111+
}, 50);
112+
});
88113
})(jQuery);

0 commit comments

Comments
 (0)