Commit f01ce091 authored by Clement Ho's avatar Clement Ho Committed by Alfredo Sumaran

Reset filters after click

parent 87b9cee3
...@@ -38,6 +38,7 @@ ...@@ -38,6 +38,7 @@
gl.FilteredSearchDropdownManager.addWordToInput(this.filter, value, true); gl.FilteredSearchDropdownManager.addWordToInput(this.filter, value, true);
} }
this.resetFilters();
this.dismissDropdown(); this.dismissDropdown();
this.dispatchInputEvent(); this.dispatchInputEvent();
} }
...@@ -107,7 +108,7 @@ ...@@ -107,7 +108,7 @@
const hook = this.getCurrentHook(); const hook = this.getCurrentHook();
if (hook) { if (hook) {
const data = hook.list.data; const data = hook.list.data || [];
const results = data.map((o) => { const results = data.map((o) => {
const updated = o; const updated = o;
updated.droplab_hidden = false; updated.droplab_hidden = false;
......
...@@ -49,6 +49,26 @@ feature 'Merge requests filter clear button', feature: true, js: true do ...@@ -49,6 +49,26 @@ feature 'Merge requests filter clear button', feature: true, js: true do
end end
end end
context 'when multiple label filters have been applied' do
let!(:label) { create(:label, project: project, name: 'Frontend') }
let(:filter_dropdown) { find("#js-dropdown-label .filter-dropdown") }
before do
visit_merge_requests(project)
init_label_search
end
it 'filters bug label' do
filtered_search.set('~bug')
filter_dropdown.find('.filter-dropdown-item', text: bug.title).click
init_label_search
expect(filter_dropdown.find('.filter-dropdown-item', text: bug.title)).to be_visible
expect(filter_dropdown.find('.filter-dropdown-item', text: label.title)).to be_visible
end
end
context 'when a text search has been conducted' do context 'when a text search has been conducted' do
it 'resets the text search filter' do it 'resets the text search filter' do
visit_merge_requests(project, search: 'Bug') visit_merge_requests(project, search: 'Bug')
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment