diff options
author | Alfredo Sumaran <alfredo@gitlab.com> | 2017-01-16 23:03:20 +0300 |
---|---|---|
committer | Alfredo Sumaran <alfredo@gitlab.com> | 2017-01-16 23:03:20 +0300 |
commit | 142be72a2aa6920fa60cc267737f2e702fdeae12 (patch) | |
tree | 0bf4451385041f2d9ad414d098c85d178105e10c /spec | |
parent | 79373bdc5c025f189f3f17162945765a2617e820 (diff) | |
parent | f0ed80a234c75585685625c7c125cdd0fb832978 (diff) |
Merge branch '26616-fix-search-group-project-filters' into 'master'
Fix search group/project filtering to show results
Closes #26616
See merge request !8565
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'); + }); }); })(); |