Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
click eventsssssss
var clickTouch = false;
var clickHandler = function(e){
clickTouch = e.touches;
}
document.addEventListener('mousedown', clickHandler);
waitsFor(function(){
return clickTouch !== false;
});
var me = document.createEvent('MouseEvent');
me.initMouseEvent('mousedown', true, true, window, {}, 0,0,0,0,false, false, false, false, 0, null);
document.dispatchEvent(me);
runs(function(){
expect(clickTouch instanceof Array).toEqual(true);
});
document.removeEventListener('mousedown', clickHandler);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.