diff options
author | Phil Hughes <me@iamphill.com> | 2017-01-17 16:34:07 +0300 |
---|---|---|
committer | Phil Hughes <me@iamphill.com> | 2017-01-17 16:34:07 +0300 |
commit | c0ba747c586ff7f5f42097a0e49eace30c57ebdf (patch) | |
tree | 89b58aa0b6162f4aee0bd8f834cc65e12e6c6c85 /spec/javascripts | |
parent | dc623cf44e691cfe3e53decf66e36c25394dadb3 (diff) | |
parent | e7fdb1aae5a61b30f66ea3489d4e0759ed8ea3a1 (diff) |
Merge branch 'master' into go-go-gadget-webpack
Diffstat (limited to 'spec/javascripts')
-rw-r--r-- | spec/javascripts/gl_dropdown_spec.js.es6 | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/spec/javascripts/gl_dropdown_spec.js.es6 b/spec/javascripts/gl_dropdown_spec.js.es6 index c60fbd73c63..83e1638cdc6 100644 --- a/spec/javascripts/gl_dropdown_spec.js.es6 +++ b/spec/javascripts/gl_dropdown_spec.js.es6 @@ -49,6 +49,9 @@ require('~/lib/utils/type_utility'); selectable: true, filterable: isFilterable, data: hasRemote ? remoteMock.bind({}, this.projectsData) : this.projectsData, + search: { + fields: ['name'] + }, text: (project) => { (project.name_with_namespace || project.name); }, @@ -166,5 +169,21 @@ require('~/lib/utils/type_utility'); expect($(document.activeElement)).toEqual($(SEARCH_INPUT_SELECTOR)); }); }); + + + it('should still have input value on close and restore', () => { + let $searchInput = $(SEARCH_INPUT_SELECTOR); + initDropDown.call(this, false, true); + $searchInput + .trigger('focus') + .val('g') + .trigger('input'); + expect($searchInput.val()).toEqual('g'); + this.dropdownButtonElement.trigger('hidden.bs.dropdown'); + $searchInput + .trigger('blur') + .trigger('focus'); + expect($searchInput.val()).toEqual('g'); + }); }); })(); |