aboutsummaryrefslogtreecommitdiffstats
path: root/test/ngMobile/directive/ngClickSpec.js
diff options
context:
space:
mode:
authorBraden Shepherdson2013-07-24 16:34:30 -0700
committerIgor Minar2013-07-24 19:02:06 -0700
commitfb7d891dacdcb9f799061d5fbb96cdd2dd912196 (patch)
tree4b07fa9a2e71e1193bb03b0c16accb0cf13e9f85 /test/ngMobile/directive/ngClickSpec.js
parentd87fa0042375b025b98c40bff05e5f42c00af114 (diff)
downloadangular.js-fb7d891dacdcb9f799061d5fbb96cdd2dd912196.tar.bz2
fix(ngMobile): emit click event for touchy clicks
Previously, no handlers for the click event would be called for the fast, touch-based ngMobile clicks, only for desktop browser clicks. Now the event will fire properly for all clicks. Closes #3219 Closes #3218 Closes #3137
Diffstat (limited to 'test/ngMobile/directive/ngClickSpec.js')
-rw-r--r--test/ngMobile/directive/ngClickSpec.js16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/ngMobile/directive/ngClickSpec.js b/test/ngMobile/directive/ngClickSpec.js
index 1147f0a2..9038514c 100644
--- a/test/ngMobile/directive/ngClickSpec.js
+++ b/test/ngMobile/directive/ngClickSpec.js
@@ -358,4 +358,20 @@ describe('ngClick (mobile)', function() {
});
+ describe('the normal click event', function() {
+ it('should be capturable by other handlers', inject(function($rootScope, $compile) {
+ var called = false;
+
+ element = $compile('<div ng-click="event = $event" ></div>')($rootScope);
+
+ element.on('click', function() {
+ called = true;
+ });
+
+ browserTrigger(element, 'touchstart', [], 10, 10);
+ browserTrigger(element, 'touchend', [], 10, 10);
+
+ expect(called).toEqual(true);
+ }));
+ });
});