diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-12-17 14:59:07 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-12-17 14:59:07 +0300 |
commit | 8b573c94895dc0ac0e1d9d59cf3e8745e8b539ca (patch) | |
tree | 544930fb309b30317ae9797a9683768705d664c4 /spec/features/search | |
parent | 4b1de649d0168371549608993deac953eb692019 (diff) |
Add latest changes from gitlab-org/gitlab@13-7-stable-eev13.7.0-rc42
Diffstat (limited to 'spec/features/search')
6 files changed, 49 insertions, 22 deletions
diff --git a/spec/features/search/user_searches_for_code_spec.rb b/spec/features/search/user_searches_for_code_spec.rb index f761bd30baf..ee3717b3e42 100644 --- a/spec/features/search/user_searches_for_code_spec.rb +++ b/spec/features/search/user_searches_for_code_spec.rb @@ -27,8 +27,13 @@ RSpec.describe 'User searches for code' do context 'when on a project page', :js do before do visit(search_path) - find('.js-search-project-dropdown').click - find('[data-testid="project-filter"]').click_link(project.full_name) + find('[data-testid="project-filter"]').click + + wait_for_requests + + page.within('[data-testid="project-filter"]') do + click_on(project.full_name) + end end include_examples 'top right search form' diff --git a/spec/features/search/user_searches_for_issues_spec.rb b/spec/features/search/user_searches_for_issues_spec.rb index e2ae2738d2f..e253b9f2f7a 100644 --- a/spec/features/search/user_searches_for_issues_spec.rb +++ b/spec/features/search/user_searches_for_issues_spec.rb @@ -85,8 +85,13 @@ RSpec.describe 'User searches for issues', :js do context 'when on a project page' do it 'finds an issue' do - find('.js-search-project-dropdown').click - find('[data-testid="project-filter"]').click_link(project.full_name) + find('[data-testid="project-filter"]').click + + wait_for_requests + + page.within('[data-testid="project-filter"]') do + click_on(project.full_name) + end search_for_issue(issue1.title) diff --git a/spec/features/search/user_searches_for_merge_requests_spec.rb b/spec/features/search/user_searches_for_merge_requests_spec.rb index 6f8f6303b66..21e8075739f 100644 --- a/spec/features/search/user_searches_for_merge_requests_spec.rb +++ b/spec/features/search/user_searches_for_merge_requests_spec.rb @@ -30,8 +30,13 @@ RSpec.describe 'User searches for merge requests', :js do context 'when on a project page' do it 'finds a merge request' do - find('.js-search-project-dropdown').click - find('[data-testid="project-filter"]').click_link(project.full_name) + find('[data-testid="project-filter"]').click + + wait_for_requests + + page.within('[data-testid="project-filter"]') do + click_on(project.full_name) + end fill_in('dashboard_search', with: merge_request1.title) find('.btn-search').click diff --git a/spec/features/search/user_searches_for_milestones_spec.rb b/spec/features/search/user_searches_for_milestones_spec.rb index 1a2227db214..f4df91dbc08 100644 --- a/spec/features/search/user_searches_for_milestones_spec.rb +++ b/spec/features/search/user_searches_for_milestones_spec.rb @@ -30,8 +30,13 @@ RSpec.describe 'User searches for milestones', :js do context 'when on a project page' do it 'finds a milestone' do - find('.js-search-project-dropdown').click - find('[data-testid="project-filter"]').click_link(project.full_name) + find('[data-testid="project-filter"]').click + + wait_for_requests + + page.within('[data-testid="project-filter"]') do + click_on(project.full_name) + end fill_in('dashboard_search', with: milestone1.title) find('.btn-search').click diff --git a/spec/features/search/user_searches_for_wiki_pages_spec.rb b/spec/features/search/user_searches_for_wiki_pages_spec.rb index 6bf1407fd4f..72bd1193fc9 100644 --- a/spec/features/search/user_searches_for_wiki_pages_spec.rb +++ b/spec/features/search/user_searches_for_wiki_pages_spec.rb @@ -18,8 +18,13 @@ RSpec.describe 'User searches for wiki pages', :js do shared_examples 'search wiki blobs' do it 'finds a page' do - find('.js-search-project-dropdown').click - find('[data-testid="project-filter"]').click_link(project.full_name) + find('[data-testid="project-filter"]').click + + wait_for_requests + + page.within('[data-testid="project-filter"]') do + click_on(project.full_name) + end fill_in('dashboard_search', with: search_term) find('.btn-search').click diff --git a/spec/features/search/user_uses_search_filters_spec.rb b/spec/features/search/user_uses_search_filters_spec.rb index bd77e6003e3..86017ca64c5 100644 --- a/spec/features/search/user_uses_search_filters_spec.rb +++ b/spec/features/search/user_uses_search_filters_spec.rb @@ -28,13 +28,15 @@ RSpec.describe 'User uses search filters', :js do expect(find('[data-testid="group-filter"]')).to have_content(group.name) - page.within('[data-testid="project-filter"]') do - find('.js-search-project-dropdown').click + find('[data-testid="project-filter"]').click - wait_for_requests + wait_for_requests - expect(page).to have_link(group_project.full_name) + page.within('[data-testid="project-filter"]') do + click_on(group_project.full_name) end + + expect(find('[data-testid="project-filter"]')).to have_content(group_project.full_name) end context 'when the group filter is set' do @@ -58,15 +60,15 @@ RSpec.describe 'User uses search filters', :js do it 'shows a project' do visit search_path - page.within('[data-testid="project-filter"]') do - find('.js-search-project-dropdown').click + find('[data-testid="project-filter"]').click - wait_for_requests + wait_for_requests - click_link(project.full_name) + page.within('[data-testid="project-filter"]') do + click_on(project.full_name) end - expect(find('.js-search-project-dropdown')).to have_content(project.full_name) + expect(find('[data-testid="project-filter"]')).to have_content(project.full_name) end context 'when the project filter is set' do @@ -78,10 +80,10 @@ RSpec.describe 'User uses search filters', :js do describe 'clear filter button' do it 'removes Project filters' do - link = find('[data-testid="project-filter"] .js-search-clear') - params = CGI.parse(URI.parse(link[:href]).query) + find('[data-testid="project-filter"] [data-testid="clear-icon"]').click + wait_for_requests - expect(params).not_to include(:project_id) + expect(page).to have_current_path(search_path(search: "test")) end end end |