Commit 6cbf6c52 authored by Eric Eastwood's avatar Eric Eastwood

Move clear search test to JS to reduce overkill

Part of https://gitlab.com/gitlab-org/gitlab-ce/issues/33661
parent 2f644452
...@@ -79,22 +79,6 @@ feature 'Merge Request filtering by Labels', :js do ...@@ -79,22 +79,6 @@ feature 'Merge Request filtering by Labels', :js do
end end
end end
context 'clear button' do
before do
input_filtered_search('label:~bug')
end
it 'allows user to remove filtered labels' do
first('.clear-search').click
filtered_search.send_keys(:enter)
expect(page).to have_issuable_counts(open: 3, closed: 0, all: 3)
expect(page).to have_content "Bugfix2"
expect(page).to have_content "Feature1"
expect(page).to have_content "Bugfix1"
end
end
context 'filter dropdown' do context 'filter dropdown' do
it 'filters by label name' do it 'filters by label name' do
init_label_search init_label_search
......
...@@ -396,6 +396,25 @@ describe('Filtered Search Manager', () => { ...@@ -396,6 +396,25 @@ describe('Filtered Search Manager', () => {
}); });
}); });
describe('Clearing search', () => {
beforeEach(() => {
initializeManager();
});
it('Clicking the "x" clear button, clears the input', () => {
const inputValue = 'label:~bug ';
manager.filteredSearchInput.value = inputValue;
manager.filteredSearchInput.dispatchEvent(new Event('input'));
expect(gl.DropdownUtils.getSearchQuery()).toEqual(inputValue);
manager.clearSearchButton.click();
expect(manager.filteredSearchInput.value).toEqual('');
expect(gl.DropdownUtils.getSearchQuery()).toEqual('');
});
});
describe('toggleInputContainerFocus', () => { describe('toggleInputContainerFocus', () => {
beforeEach(() => { beforeEach(() => {
initializeManager(); initializeManager();
......
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