summaryrefslogtreecommitdiffstats
path: root/test/api/closeSpec.js
diff options
context:
space:
mode:
authorJim Fitzpatrick <fitzpatrick.jim@gmail.com>2016-06-21 21:45:43 -0400
committerJim Fitzpatrick <fitzpatrick.jim@gmail.com>2016-06-22 08:39:46 -0400
commit8c0ff6225c96af2f5f3b7312d7ba7b69f71be575 (patch)
tree1893639afb3cb78b9275635662f4c0f06d54986e /test/api/closeSpec.js
parentccd4e20ab1adf58bb0be4a121dcdc54c49f1029a (diff)
downloadawesomplete-8c0ff6225c96af2f5f3b7312d7ba7b69f71be575.zip
awesomplete-8c0ff6225c96af2f5f3b7312d7ba7b69f71be575.tar.gz
awesomplete-8c0ff6225c96af2f5f3b7312d7ba7b69f71be575.tar.bz2
Emit close reason with awesomplete-close events
Emit a reason when firing `awesomplete-close` events to provide transparency to attached event listeners regarding the circumstance in which the close was triggered. Reasons include `blur`, `esc`, `submit`, `select`, and `nomatches`. Closes #16897
Diffstat (limited to 'test/api/closeSpec.js')
-rw-r--r--test/api/closeSpec.js4
1 files changed, 3 insertions, 1 deletions
diff --git a/test/api/closeSpec.js b/test/api/closeSpec.js
index 65228ff..a39687c 100644
--- a/test/api/closeSpec.js
+++ b/test/api/closeSpec.js
@@ -24,7 +24,9 @@ describe("awesomplete.close", function () {
var handler = $.spyOnEvent(this.subject.input, "awesomplete-close");
this.subject.close();
- expect(handler).toHaveBeenCalled();
+ expect(handler).toHaveBeenCalledWith(
+ jasmine.any(document.createEvent('HTMLEvents').constructor)
+ );
});
it("returns early if already closed", function () {