summaryrefslogtreecommitdiffstats
path: root/test/api/selectSpec.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/selectSpec.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/selectSpec.js')
-rw-r--r--test/api/selectSpec.js4
1 files changed, 3 insertions, 1 deletions
diff --git a/test/api/selectSpec.js b/test/api/selectSpec.js
index f972142..4224301 100644
--- a/test/api/selectSpec.js
+++ b/test/api/selectSpec.js
@@ -66,7 +66,9 @@ describe("awesomplete.select", function () {
spyOn(this.subject, "close");
this.subject.select(this.selectArgument);
- expect(this.subject.close).toHaveBeenCalled();
+ expect(this.subject.close).toHaveBeenCalledWith({
+ reason: 'select'
+ });
});
it("fires awesomplete-selectcomplete event", function () {