diff options
-rw-r--r-- | test/events/mousedownSpec.js | 8 | ||||
-rw-r--r-- | test/specHelper.js | 5 |
2 files changed, 7 insertions, 6 deletions
diff --git a/test/events/mousedownSpec.js b/test/events/mousedownSpec.js index 5de338e..8b75b84 100644 --- a/test/events/mousedownSpec.js +++ b/test/events/mousedownSpec.js @@ -31,8 +31,8 @@ describe("mousedown event", function () { describe("on left click", function () { it("selects item", function () { - $.fire(this.target, "mousedown", { button: 0 }); - expect(this.subject.select).toHaveBeenCalledWith(this.li); + var event = $.fire(this.target, "mousedown", { button: 0 }); + expect(this.subject.select).toHaveBeenCalledWith(this.li, event); }); }); @@ -48,8 +48,8 @@ describe("mousedown event", function () { def("target", function () { return $("mark", this.li) }); it("selects item", function () { - $.fire(this.target, "mousedown", { button: 0 }); - expect(this.subject.select).toHaveBeenCalledWith(this.li); + var event = $.fire(this.target, "mousedown", { button: 0 }); + expect(this.subject.select).toHaveBeenCalledWith(this.li, event); }); }); }); diff --git a/test/specHelper.js b/test/specHelper.js index 58282e5..4bdd318 100644 --- a/test/specHelper.js +++ b/test/specHelper.js @@ -40,18 +40,19 @@ $.fire = function (target, type, properties) { evt[j] = properties[j]; } target.dispatchEvent(evt); + return evt; }; // simulates text input (very simple, only "input" event is fired) $.type = function (input, text) { input.focus(); input.value = text; - $.fire(input, "input"); + return $.fire(input, "input"); }; // simulates keydown events $.keydown = function (target, keyCode) { - $.fire(target, "keydown", { keyCode: keyCode }); + return $.fire(target, "keydown", { keyCode: keyCode }); }; $.k = { ENTER: 13, |