More Events.js tests.

This commit is contained in:
ahocevar
2012-06-26 00:00:36 +02:00
parent 1d12c1b5d8
commit 56542de1f3

View File

@@ -136,7 +136,7 @@ describe("ol.event.Events", function() {
this.target = target; this.target = target;
}; };
Sequence.prototype.fire = function() { Sequence.prototype.fire = function() {
this.target.dispatchEvent("myevent"); this.target.triggerEvent("myevent");
}; };
Sequence.prototype.destroy = function() { Sequence.prototype.destroy = function() {
this.destroyed = true; this.destroyed = true;
@@ -172,4 +172,10 @@ describe("ol.event.Events", function() {
expect(ol.event.isMultiTouch({})).toBe(false); expect(ol.event.isMultiTouch({})).toBe(false);
}); });
it("provides an isEnterOrSpace() function", function() {
expect(ol.event.isEnterOrSpace({type: 'keypress', keyCode: 13})).toBe(true);
expect(ol.event.isEnterOrSpace({type: 'keypress', keyCode: 32})).toBe(true);
expect(ol.event.isEnterOrSpace({type: 'keypress', keyCode: 3})).toBe(true);
});
}); });