diff options
author | Eric Eastwood <contact@ericeastwood.com> | 2017-01-13 11:12:44 -0500 |
---|---|---|
committer | Eric Eastwood <contact@ericeastwood.com> | 2017-01-16 12:18:59 -0500 |
commit | f0ed80a234c75585685625c7c125cdd0fb832978 (patch) | |
tree | 4a64563f2ec77e10bbe74c8a5e426c99f5de988e /spec | |
parent | 6c1190623fb4d69786efb955b3af0b9241974776 (diff) | |
download | gitlab-ce-f0ed80a234c75585685625c7c125cdd0fb832978.tar.gz |
Fix dropdown filter input value after blur26616-fix-search-group-project-filters
Diffstat (limited to 'spec')
-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 ce96571bd52..d11b1182d9a 100644 --- a/spec/javascripts/gl_dropdown_spec.js.es6 +++ b/spec/javascripts/gl_dropdown_spec.js.es6 @@ -50,6 +50,9 @@ selectable: true, filterable: isFilterable, data: hasRemote ? remoteMock.bind({}, this.projectsData) : this.projectsData, + search: { + fields: ['name'] + }, text: (project) => { (project.name_with_namespace || project.name); }, @@ -167,5 +170,21 @@ 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'); + }); }); })(); |