Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

added tap hold test

  • Loading branch information...
commit 16ed9dc661881d61d9550a3ef8342f60894f4b01 1 parent 2931fff
@johnbender johnbender authored
Showing with 30 additions and 0 deletions.
  1. +30 −0 tests/unit/event/event_core.js
View
30 tests/unit/event/event_core.js
@@ -108,5 +108,35 @@
start();
ok(triggered);
}, 50);
+
+ //NOTE async tests below won't fire unless start is called (??)
+ start();
+ });
+
+ test( "long press fires tap hold after 750 ms", function(){
+ var taphold = false;
+ $.support.touch = true;
+
+ $.testHelper.reloadLib(libName);
+
+ stop();
+ $($.event.special.tap).bind("taphold", function(){
+ start();
+ taphold = true;
+ });
+
+ $($.event.special.tap).trigger("touchstart");
+
+ stop();
+ setTimeout(function(){
+ start();
+ ok(!taphold);
+ }, 749);
+
+ stop();
+ setTimeout(function(){
+ start();
+ ok(taphold);
+ }, 751);
});
})(jQuery);
Please sign in to comment.
Something went wrong with that request. Please try again.