diff options
Diffstat (limited to 'spec/features/search')
6 files changed, 8 insertions, 23 deletions
diff --git a/spec/features/search/user_searches_for_code_spec.rb b/spec/features/search/user_searches_for_code_spec.rb index a88043c98ac..f761bd30baf 100644 --- a/spec/features/search/user_searches_for_code_spec.rb +++ b/spec/features/search/user_searches_for_code_spec.rb @@ -28,10 +28,7 @@ RSpec.describe 'User searches for code' do before do visit(search_path) find('.js-search-project-dropdown').click - - page.within('.project-filter') do - click_link(project.full_name) - end + find('[data-testid="project-filter"]').click_link(project.full_name) 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 35d5722f708..e2ae2738d2f 100644 --- a/spec/features/search/user_searches_for_issues_spec.rb +++ b/spec/features/search/user_searches_for_issues_spec.rb @@ -86,10 +86,7 @@ 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 - - page.within('.project-filter') do - click_link(project.full_name) - end + find('[data-testid="project-filter"]').click_link(project.full_name) 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 40583664958..6f8f6303b66 100644 --- a/spec/features/search/user_searches_for_merge_requests_spec.rb +++ b/spec/features/search/user_searches_for_merge_requests_spec.rb @@ -31,10 +31,7 @@ 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 - - page.within('.project-filter') do - click_link(project.full_name) - end + find('[data-testid="project-filter"]').click_link(project.full_name) 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 64e756db180..1a2227db214 100644 --- a/spec/features/search/user_searches_for_milestones_spec.rb +++ b/spec/features/search/user_searches_for_milestones_spec.rb @@ -31,10 +31,7 @@ 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 - - page.within('.project-filter') do - click_link(project.full_name) - end + find('[data-testid="project-filter"]').click_link(project.full_name) 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 fc60b6244d9..6bf1407fd4f 100644 --- a/spec/features/search/user_searches_for_wiki_pages_spec.rb +++ b/spec/features/search/user_searches_for_wiki_pages_spec.rb @@ -19,10 +19,7 @@ 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 - - page.within('.project-filter') do - click_link(project.full_name) - end + find('[data-testid="project-filter"]').click_link(project.full_name) 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 080cced21c3..a1afba1a371 100644 --- a/spec/features/search/user_uses_search_filters_spec.rb +++ b/spec/features/search/user_uses_search_filters_spec.rb @@ -28,7 +28,7 @@ RSpec.describe 'User uses search filters', :js do expect(find('.js-search-group-dropdown')).to have_content(group.name) - page.within('.project-filter') do + page.within('[data-testid="project-filter"]') do find('.js-search-project-dropdown').click wait_for_requests @@ -57,7 +57,7 @@ RSpec.describe 'User uses search filters', :js do it 'shows a project' do visit search_path - page.within('.project-filter') do + page.within('[data-testid="project-filter"]') do find('.js-search-project-dropdown').click wait_for_requests @@ -77,7 +77,7 @@ RSpec.describe 'User uses search filters', :js do describe 'clear filter button' do it 'removes Project filters' do - link = find('.project-filter .js-search-clear') + link = find('[data-testid="project-filter"] .js-search-clear') params = CGI.parse(URI.parse(link[:href]).query) expect(params).not_to include(:project_id) |