1
0
mirror of https://github.com/chubin/cheat.sh.git synced 2026-06-20 21:26:44 +02:00
Files
cheat.sh/share/static/awesomplete-gh-pages/test/events/submitSpec.js
T
2017-05-08 21:17:29 +00:00

18 lines
583 B
JavaScript

describe("form submit event", function () {
$.fixture("options");
subject(function () { return new Awesomplete("#inside-form") });
it("closes completer", function () {
spyOn(Awesomplete.prototype, "close");
// prevent full page reload in Firefox, which causes tests to stop running
$.on(this.subject.input.form, "submit", function (evt) { evt.preventDefault() });
$.fire(this.subject.input.form, "submit");
expect(Awesomplete.prototype.close).toHaveBeenCalledWith(
{ reason: "submit" },
jasmine.any(document.createEvent("HTMLEvents").constructor)
);
});
});