diff options
author | Jim Fitzpatrick <fitzpatrick.jim@gmail.com> | 2016-06-21 21:45:43 -0400 |
---|---|---|
committer | Jim Fitzpatrick <fitzpatrick.jim@gmail.com> | 2016-06-22 08:39:46 -0400 |
commit | 8c0ff6225c96af2f5f3b7312d7ba7b69f71be575 (patch) | |
tree | 1893639afb3cb78b9275635662f4c0f06d54986e /test/api/closeSpec.js | |
parent | ccd4e20ab1adf58bb0be4a121dcdc54c49f1029a (diff) | |
download | awesomplete-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.js | 4 |
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 () { |