diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-11-17 14:33:21 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-11-17 14:33:21 +0300 |
commit | 7021455bd1ed7b125c55eb1b33c5a01f2bc55ee0 (patch) | |
tree | 5bdc2229f5198d516781f8d24eace62fc7e589e9 /spec/features/search/user_searches_for_milestones_spec.rb | |
parent | 185b095e93520f96e9cfc31d9c3e69b498cdab7c (diff) |
Add latest changes from gitlab-org/gitlab@15-6-stable-eev15.6.0-rc42
Diffstat (limited to 'spec/features/search/user_searches_for_milestones_spec.rb')
-rw-r--r-- | spec/features/search/user_searches_for_milestones_spec.rb | 67 |
1 files changed, 37 insertions, 30 deletions
diff --git a/spec/features/search/user_searches_for_milestones_spec.rb b/spec/features/search/user_searches_for_milestones_spec.rb index 6773059830c..702d4e60022 100644 --- a/spec/features/search/user_searches_for_milestones_spec.rb +++ b/spec/features/search/user_searches_for_milestones_spec.rb @@ -2,44 +2,30 @@ require 'spec_helper' -RSpec.describe 'User searches for milestones', :js do - let(:user) { create(:user) } - let(:project) { create(:project, namespace: user.namespace) } - let!(:milestone1) { create(:milestone, title: 'Foo', project: project) } - let!(:milestone2) { create(:milestone, title: 'Bar', project: project) } +RSpec.describe 'User searches for milestones', :js, :clean_gitlab_redis_rate_limiting do + using RSpec::Parameterized::TableSyntax - before do - project.add_maintainer(user) - sign_in(user) - stub_feature_flags(search_page_vertical_nav: false) + let_it_be(:user) { create(:user) } + let_it_be(:project) { create(:project, namespace: user.namespace) } - visit(search_path) - end + let!(:milestone1) { create(:milestone, title: 'Foo', project: project) } + let!(:milestone2) { create(:milestone, title: 'Bar', project: project) } - include_examples 'top right search form' - include_examples 'search timeouts', 'milestones' + where(search_page_vertical_nav_enabled: [true, false]) - it 'finds a milestone' do - fill_in('dashboard_search', with: milestone1.title) - find('.gl-search-box-by-click-search-button').click - select_search_scope('Milestones') + with_them do + before do + project.add_maintainer(user) + sign_in(user) + stub_feature_flags(search_page_vertical_nav: search_page_vertical_nav_enabled) - page.within('.results') do - expect(page).to have_link(milestone1.title) - expect(page).not_to have_link(milestone2.title) + visit(search_path) end - end - - context 'when on a project page' do - it 'finds a milestone' do - find('[data-testid="project-filter"]').click - - wait_for_requests - page.within('[data-testid="project-filter"]') do - click_on(project.name) - end + include_examples 'top right search form' + include_examples 'search timeouts', 'milestones' + it 'finds a milestone' do fill_in('dashboard_search', with: milestone1.title) find('.gl-search-box-by-click-search-button').click select_search_scope('Milestones') @@ -49,5 +35,26 @@ RSpec.describe 'User searches for milestones', :js do expect(page).not_to have_link(milestone2.title) end end + + context 'when on a project page' do + it 'finds a milestone' do + find('[data-testid="project-filter"]').click + + wait_for_requests + + page.within('[data-testid="project-filter"]') do + click_on(project.name) + end + + fill_in('dashboard_search', with: milestone1.title) + find('.gl-search-box-by-click-search-button').click + select_search_scope('Milestones') + + page.within('.results') do + expect(page).to have_link(milestone1.title) + expect(page).not_to have_link(milestone2.title) + end + end + end end end |