Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

test: check for valid event type.

  • Loading branch information...
commit d4f8e817d5a3961a08fd5bee46f527035ee56f21 1 parent 1553fb9
@ngryman authored
Showing with 35 additions and 0 deletions.
  1. +35 −0 test/jquery.finger_test.js
View
35 test/jquery.finger_test.js
@@ -136,6 +136,13 @@
handler.should.have.been.calledOn(this.$elems[0]);
});
+ it('should pass the correct event type', function() {
+ this.$elems.on('tap', function(e) {
+ e.type.should.equal('tap');
+ });
+ this.tap();
+ });
+
it('should fire handlers in order', function() {
var handler1 = sinon.spy();
var handler2 = sinon.spy();
@@ -216,6 +223,13 @@
});
});
+ it('should pass the correct event type', function(done) {
+ this.$elems.on('press', function(e) {
+ e.type.should.equal('press');
+ });
+ this.press(done);
+ });
+
it('should not fire tap event', function(done) {
var handler1 = sinon.spy();
var handler2 = sinon.spy();
@@ -258,6 +272,13 @@
done();
});
});
+
+ it('should pass the correct event type', function(done) {
+ this.$elems.on('doubletap', function(e) {
+ e.type.should.equal('doubletap');
+ });
+ this.doubleTap(done);
+ });
});
describe('drag event', function() {
@@ -281,6 +302,13 @@
}, 100, 0);
});
+ it('should pass the correct event type', function(done) {
+ this.$elems.on('drag', function(e) {
+ e.type.should.equal('drag');
+ });
+ this.drag(done);
+ });
+
it('should pass valid coordinates', function(done) {
var lastX = -1;
var lastY = -1;
@@ -381,6 +409,13 @@
done();
}, 100, 0);
});
+
+ it('should pass the correct event type', function(done) {
+ this.$elems.on('flick', function(e) {
+ e.type.should.equal('flick');
+ });
+ this.flick(done);
+ });
});
});
Please sign in to comment.
Something went wrong with that request. Please try again.