diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-01-21 15:08:26 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-01-21 15:08:26 +0000 |
commit | c859c3bfd242288065fe5e2d887f7204f09e2335 (patch) | |
tree | 10febaf8774a3ea6ab3773c0dd97658d673fb280 /spec/features | |
parent | 28ce39a3e0e7b47e53939a15fb823af9c433327a (diff) | |
download | gitlab-ce-c859c3bfd242288065fe5e2d887f7204f09e2335.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/features')
4 files changed, 52 insertions, 7 deletions
diff --git a/spec/features/admin/admin_settings_spec.rb b/spec/features/admin/admin_settings_spec.rb index 99a6165cfc9..b31c5e30fc0 100644 --- a/spec/features/admin/admin_settings_spec.rb +++ b/spec/features/admin/admin_settings_spec.rb @@ -9,7 +9,7 @@ describe 'Admin updates settings', :clean_gitlab_redis_shared_state, :do_not_moc let(:admin) { create(:admin) } - context 'feature flag :user_mode_in_session is enabled' do + context 'feature flag :user_mode_in_session is enabled', :request_store do before do stub_env('IN_MEMORY_APPLICATION_SETTINGS', 'false') sign_in(admin) @@ -486,10 +486,24 @@ describe 'Admin updates settings', :clean_gitlab_redis_shared_state, :do_not_moc end end - it 'can leave admin mode' do + it 'can leave admin mode using main dashboard link', :js do page.within('.navbar-sub-nav') do - # Select first, link is also included in mobile view list - click_on 'Leave Admin Mode', match: :first + click_on 'Leave Admin Mode' + + expect(page).to have_link(href: new_admin_session_path) + end + end + + it 'can leave admin mode using dropdown menu on smaller screens', :js do + resize_screen_xs + visit root_dashboard_path + + find('.header-more').click + + page.within '.navbar-sub-nav' do + click_on 'Leave Admin Mode' + + find('.header-more').click expect(page).to have_link(href: new_admin_session_path) end diff --git a/spec/features/merge_request/user_sees_merge_widget_spec.rb b/spec/features/merge_request/user_sees_merge_widget_spec.rb index 098f41f120d..17754400b91 100644 --- a/spec/features/merge_request/user_sees_merge_widget_spec.rb +++ b/spec/features/merge_request/user_sees_merge_widget_spec.rb @@ -19,7 +19,7 @@ describe 'Merge request > User sees merge widget', :js do sign_in(user) end - context 'new merge request' do + context 'new merge request', :sidekiq_might_not_need_inline do before do visit project_new_merge_request_path( project, diff --git a/spec/features/merge_requests/user_squashes_merge_request_spec.rb b/spec/features/merge_requests/user_squashes_merge_request_spec.rb index a9b96c5bbf5..4115907d074 100644 --- a/spec/features/merge_requests/user_squashes_merge_request_spec.rb +++ b/spec/features/merge_requests/user_squashes_merge_request_spec.rb @@ -67,7 +67,7 @@ describe 'User squashes a merge request', :js do end end - context 'when squash is enabled on merge request creation' do + context 'when squash is enabled on merge request creation', :sidekiq_might_not_need_inline do before do visit project_new_merge_request_path(project, merge_request: { target_branch: 'master', source_branch: source_branch }) check 'merge_request[squash]' @@ -97,7 +97,7 @@ describe 'User squashes a merge request', :js do end end - context 'when squash is not enabled on merge request creation' do + context 'when squash is not enabled on merge request creation', :sidekiq_might_not_need_inline do before do visit project_new_merge_request_path(project, merge_request: { target_branch: 'master', source_branch: source_branch }) click_on 'Submit merge request' diff --git a/spec/features/milestones/user_views_milestone_spec.rb b/spec/features/milestones/user_views_milestone_spec.rb index 71abb195ad1..b1c2a87ef94 100644 --- a/spec/features/milestones/user_views_milestone_spec.rb +++ b/spec/features/milestones/user_views_milestone_spec.rb @@ -25,6 +25,37 @@ describe "User views milestone" do expect { visit_milestone }.not_to exceed_query_limit(control) end + context 'limiting milestone issues' do + before_all do + 2.times do + create(:issue, milestone: milestone, project: project) + create(:issue, milestone: milestone, project: project, assignees: [user]) + create(:issue, milestone: milestone, project: project, state: :closed) + end + end + + context 'when issues on milestone are over DISPLAY_ISSUES_LIMIT' do + it "limits issues to display and shows warning" do + stub_const('Milestoneish::DISPLAY_ISSUES_LIMIT', 3) + + visit(project_milestone_path(project, milestone)) + + expect(page).to have_selector('.issuable-row', count: 3) + expect(page).to have_selector('#milestone-issue-count-warning', text: 'Showing 3 of 6 issues. View all issues') + expect(page).to have_link('View all issues', href: project_issues_path(project)) + end + end + + context 'when issues on milestone are below DISPLAY_ISSUES_LIMIT' do + it 'does not display warning' do + visit(project_milestone_path(project, milestone)) + + expect(page).not_to have_selector('#milestone-issue-count-warning', text: 'Showing 3 of 6 issues. View all issues') + expect(page).to have_selector('.issuable-row', count: 6) + end + end + end + private def visit_milestone |