summaryrefslogtreecommitdiffstats
path: root/test/api/closeSpec.js
diff options
context:
space:
mode:
Diffstat (limited to 'test/api/closeSpec.js')
-rw-r--r--test/api/closeSpec.js8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/api/closeSpec.js b/test/api/closeSpec.js
index e22fe2f..65228ff 100644
--- a/test/api/closeSpec.js
+++ b/test/api/closeSpec.js
@@ -26,4 +26,12 @@ describe("awesomplete.close", function () {
expect(handler).toHaveBeenCalled();
});
+
+ it("returns early if already closed", function () {
+ var handler = $.spyOnEvent(this.subject.input, "awesomplete-close");
+ this.subject.close();
+ this.subject.close();
+
+ expect(handler.calls.count()).toBe(1);
+ });
});