mirror of
https://github.com/Hopiu/jquery-mobile.git
synced 2026-04-26 00:54:43 +00:00
added test for trigger inside new event closure
This commit is contained in:
parent
524008f5f3
commit
c20b589686
1 changed files with 17 additions and 1 deletions
|
|
@ -7,7 +7,13 @@
|
|||
events = ("touchstart touchmove touchend orientationchange tap taphold " +
|
||||
"swipe swipeleft swiperight scrollstart scrollstop").split( " " );
|
||||
|
||||
module(libName);
|
||||
module(libName, {
|
||||
teardown: function(){
|
||||
$.each(events, function(i, name){
|
||||
$("#main").unbind(name);
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
$.testHelper.excludeFileProtocol(function(){
|
||||
test( "new events defined on the jquery object", function(){
|
||||
|
|
@ -34,6 +40,16 @@
|
|||
$('#main').trigger(events[0]);
|
||||
});
|
||||
|
||||
test( "defined event functions trigger the event with no arguments", function(){
|
||||
expect( 1 );
|
||||
|
||||
$('#main')[events[0]](function(){
|
||||
ok(true);
|
||||
});
|
||||
|
||||
$('#main')[events[0]]();
|
||||
});
|
||||
|
||||
test( "defining event functions sets the attrFn to true", function(){
|
||||
$.each(events, function(i, name){
|
||||
ok($.attrFn[name]);
|
||||
|
|
|
|||
Loading…
Reference in a new issue