diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-04-27 15:08:19 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-04-27 15:08:19 +0300 |
commit | 863ba7d77355b305b06112b0c6c3cab3c09898b0 (patch) | |
tree | 6b657c3bfc0cff804fad6094ba61d42c6925c4d4 /spec/features | |
parent | 359bc6940b1205035e14f028b75d0c9c80a1fd5e (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/features')
-rw-r--r-- | spec/features/groups/empty_states_spec.rb | 18 | ||||
-rw-r--r-- | spec/features/issuables/issuable_list_spec.rb | 12 | ||||
-rw-r--r-- | spec/features/issue_rebalancing_spec.rb | 12 | ||||
-rw-r--r-- | spec/features/issues/rss_spec.rb | 16 | ||||
-rw-r--r-- | spec/features/issues/user_bulk_edits_issues_labels_spec.rb | 8 | ||||
-rw-r--r-- | spec/features/issues/user_creates_issue_spec.rb | 6 | ||||
-rw-r--r-- | spec/features/issues/user_filters_issues_spec.rb | 4 | ||||
-rw-r--r-- | spec/features/issues/user_sees_breadcrumb_links_spec.rb | 4 | ||||
-rw-r--r-- | spec/features/issues/user_sorts_issues_spec.rb | 17 | ||||
-rw-r--r-- | spec/features/merge_requests/user_sorts_merge_requests_spec.rb | 4 | ||||
-rw-r--r-- | spec/features/projects/jobs/user_browses_jobs_spec.rb | 2 | ||||
-rw-r--r-- | spec/features/projects/settings/pipelines_settings_spec.rb | 18 | ||||
-rw-r--r-- | spec/features/user_sorts_things_spec.rb | 9 |
13 files changed, 74 insertions, 56 deletions
diff --git a/spec/features/groups/empty_states_spec.rb b/spec/features/groups/empty_states_spec.rb index 0317f9162cc..71f38401fa1 100644 --- a/spec/features/groups/empty_states_spec.rb +++ b/spec/features/groups/empty_states_spec.rb @@ -7,6 +7,8 @@ RSpec.describe 'Group empty states' do let(:user) { create(:group_member, :developer, user: create(:user), group: group ).user } before do + stub_feature_flags(vue_issues_list: true) + sign_in(user) end @@ -100,21 +102,23 @@ RSpec.describe 'Group empty states' do end it "the new #{issuable_name} button opens a project dropdown" do - within '.empty-state' do - click_button 'Toggle project select' - end + click_button 'Toggle project select' - expect(page).to have_selector('.ajax-project-dropdown') + if issuable == :issue + expect(page).to have_button project.name + else + expect(page).to have_selector('.ajax-project-dropdown') + end end end end shared_examples "no projects" do - it 'displays an empty state' do + it 'displays an empty state', :js do expect(page).to have_selector('.empty-state') end - it "does not show a new #{issuable_name} button" do + it "does not show a new #{issuable_name} button", :js do within '.empty-state' do expect(page).not_to have_link("create #{issuable_name}") end @@ -143,7 +147,7 @@ RSpec.describe 'Group empty states' do visit path end - it 'displays an empty state' do + it 'displays an empty state', :js do expect(page).to have_selector('.empty-state') end end diff --git a/spec/features/issuables/issuable_list_spec.rb b/spec/features/issuables/issuable_list_spec.rb index a0786d36fdf..7edf5fdc5ff 100644 --- a/spec/features/issuables/issuable_list_spec.rb +++ b/spec/features/issuables/issuable_list_spec.rb @@ -9,6 +9,8 @@ RSpec.describe 'issuable list', :js do issuable_types = [:issue, :merge_request] before do + stub_feature_flags(vue_issues_list: true) + project.add_user(user, :developer) sign_in(user) issuable_types.each { |type| create_issuables(type) } @@ -34,16 +36,16 @@ RSpec.describe 'issuable list', :js do it 'sorts labels alphabetically' do label1 = create(:label, project: project, title: 'a') label2 = create(:label, project: project, title: 'z') - label3 = create(:label, project: project, title: 'X') - label4 = create(:label, project: project, title: 'B') + label3 = create(:label, project: project, title: 'x') + label4 = create(:label, project: project, title: 'b') issuable = create_issuable(issuable_type) issuable.labels << [label1, label2, label3, label4] visit_issuable_list(issuable_type) - expect(all('.gl-label-text')[0].text).to have_content('B') - expect(all('.gl-label-text')[1].text).to have_content('X') - expect(all('.gl-label-text')[2].text).to have_content('a') + expect(all('.gl-label-text')[0].text).to have_content('a') + expect(all('.gl-label-text')[1].text).to have_content('b') + expect(all('.gl-label-text')[2].text).to have_content('x') expect(all('.gl-label-text')[3].text).to have_content('z') end end diff --git a/spec/features/issue_rebalancing_spec.rb b/spec/features/issue_rebalancing_spec.rb index 978768270ec..8a05aeec7ec 100644 --- a/spec/features/issue_rebalancing_spec.rb +++ b/spec/features/issue_rebalancing_spec.rb @@ -15,6 +15,10 @@ RSpec.describe 'Issue rebalancing' do group.add_developer(user) end + before do + stub_feature_flags(vue_issues_list: true) + end + context 'when issue rebalancing is in progress' do before do sign_in(user) @@ -38,16 +42,16 @@ RSpec.describe 'Issue rebalancing' do expect(page).to have_selector('.gl-alert-info', text: alert_message_regex, count: 1) end - it 'shows an alert in project issues list with manual sort' do + it 'shows an alert in project issues list with manual sort', :js do visit project_issues_path(project, sort: 'relative_position') - expect(page).to have_selector('.gl-alert-info', text: alert_message_regex, count: 1) + expect(page).to have_selector('.flash-notice', text: alert_message_regex, count: 1) end - it 'shows an alert in group issues list with manual sort' do + it 'shows an alert in group issues list with manual sort', :js do visit issues_group_path(group, sort: 'relative_position') - expect(page).to have_selector('.gl-alert-info', text: alert_message_regex, count: 1) + expect(page).to have_selector('.flash-notice', text: alert_message_regex, count: 1) end it 'does not show an alert in project issues list with other sorts' do diff --git a/spec/features/issues/rss_spec.rb b/spec/features/issues/rss_spec.rb index b20502ecc25..bdc5f282875 100644 --- a/spec/features/issues/rss_spec.rb +++ b/spec/features/issues/rss_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'Project Issues RSS' do +RSpec.describe 'Project Issues RSS', :js do let_it_be(:user) { create(:user) } let_it_be(:group) { create(:group) } let_it_be(:project) { create(:project, group: group, visibility_level: Gitlab::VisibilityLevel::PUBLIC) } @@ -13,6 +13,10 @@ RSpec.describe 'Project Issues RSS' do group.add_developer(user) end + before do + stub_feature_flags(vue_issues_list: true) + end + context 'when signed in' do let_it_be(:user) { create(:user) } @@ -25,7 +29,10 @@ RSpec.describe 'Project Issues RSS' do visit path end - it_behaves_like "it has an RSS button with current_user's feed token" + it "shows the RSS button with current_user's feed token" do + expect(page).to have_link 'Subscribe to RSS feed', href: /feed_token=#{user.feed_token}/ + end + it_behaves_like "an autodiscoverable RSS feed with current_user's feed token" end @@ -34,7 +41,10 @@ RSpec.describe 'Project Issues RSS' do visit path end - it_behaves_like "it has an RSS button without a feed token" + it "shows the RSS button without a feed token" do + expect(page).not_to have_link 'Subscribe to RSS feed', href: /feed_token/ + end + it_behaves_like "an autodiscoverable RSS feed without a feed token" end diff --git a/spec/features/issues/user_bulk_edits_issues_labels_spec.rb b/spec/features/issues/user_bulk_edits_issues_labels_spec.rb index 71213fb661f..27377f6e1fd 100644 --- a/spec/features/issues/user_bulk_edits_issues_labels_spec.rb +++ b/spec/features/issues/user_bulk_edits_issues_labels_spec.rb @@ -12,8 +12,12 @@ RSpec.describe 'Issues > Labels bulk assignment' do let!(:issue1) { create(:issue, project: project, title: "Issue 1", labels: [frontend]) } let!(:issue2) { create(:issue, project: project, title: "Issue 2") } - let(:issue_1_selector) { "#issue_#{issue1.id}" } - let(:issue_2_selector) { "#issue_#{issue2.id}" } + let(:issue_1_selector) { "#issuable_#{issue1.id}" } + let(:issue_2_selector) { "#issuable_#{issue2.id}" } + + before do + stub_feature_flags(vue_issues_list: true) + end context 'as an allowed user', :js do before do diff --git a/spec/features/issues/user_creates_issue_spec.rb b/spec/features/issues/user_creates_issue_spec.rb index 8a5e33ba18c..3bba041dab7 100644 --- a/spec/features/issues/user_creates_issue_spec.rb +++ b/spec/features/issues/user_creates_issue_spec.rb @@ -8,12 +8,16 @@ RSpec.describe "User creates issue" do let_it_be(:project) { create(:project_empty_repo, :public) } let_it_be(:user) { create(:user) } + before do + stub_feature_flags(vue_issues_list: true) + end + context "when unauthenticated" do before do sign_out(:user) end - it "redirects to signin then back to new issue after signin" do + it "redirects to signin then back to new issue after signin", :js do create(:issue, project: project) visit project_issues_path(project) diff --git a/spec/features/issues/user_filters_issues_spec.rb b/spec/features/issues/user_filters_issues_spec.rb index 5d05df6aaf0..42c2b5d32c1 100644 --- a/spec/features/issues/user_filters_issues_spec.rb +++ b/spec/features/issues/user_filters_issues_spec.rb @@ -7,6 +7,8 @@ RSpec.describe 'User filters issues', :js do let_it_be(:project) { create(:project_empty_repo, :public) } before do + stub_feature_flags(vue_issues_list: true) + %w[foobar barbaz].each do |title| create(:issue, author: user, @@ -24,7 +26,7 @@ RSpec.describe 'User filters issues', :js do let(:issue) { @issue } it 'allows filtering by issues with no specified assignee' do - visit project_issues_path(project, assignee_id: IssuableFinder::Params::FILTER_NONE) + visit project_issues_path(project, assignee_id: IssuableFinder::Params::FILTER_NONE.capitalize) expect(page).to have_content 'foobar' expect(page).not_to have_content 'barbaz' diff --git a/spec/features/issues/user_sees_breadcrumb_links_spec.rb b/spec/features/issues/user_sees_breadcrumb_links_spec.rb index 669c7c45411..44fa062480a 100644 --- a/spec/features/issues/user_sees_breadcrumb_links_spec.rb +++ b/spec/features/issues/user_sees_breadcrumb_links_spec.rb @@ -8,6 +8,8 @@ RSpec.describe 'New issue breadcrumb' do let(:user) { project.creator } before do + stub_feature_flags(vue_issues_list: true) + sign_in(user) visit(new_project_issue_path(project)) end @@ -27,7 +29,7 @@ RSpec.describe 'New issue breadcrumb' do expect(find('.breadcrumbs-sub-title a')[:href]).to end_with(issue_path(issue)) end - it 'excludes award_emoji from comment count' do + it 'excludes award_emoji from comment count', :js do issue = create(:issue, author: user, assignees: [user], project: project, title: 'foobar') create(:award_emoji, awardable: issue) diff --git a/spec/features/issues/user_sorts_issues_spec.rb b/spec/features/issues/user_sorts_issues_spec.rb index 86bdaf5d706..4af313576ed 100644 --- a/spec/features/issues/user_sorts_issues_spec.rb +++ b/spec/features/issues/user_sorts_issues_spec.rb @@ -16,6 +16,8 @@ RSpec.describe "User sorts issues" do let_it_be(:later_due_milestone) { create(:milestone, project: project, due_date: '2013-12-12') } before do + stub_feature_flags(vue_issues_list: true) + create_list(:award_emoji, 2, :upvote, awardable: issue1) create_list(:award_emoji, 2, :downvote, awardable: issue2) create(:award_emoji, :downvote, awardable: issue1) @@ -24,26 +26,23 @@ RSpec.describe "User sorts issues" do sign_in(user) end - it 'keeps the sort option' do + it 'keeps the sort option', :js do visit(project_issues_path(project)) - find('.filter-dropdown-container .dropdown').click - - page.within('ul.dropdown-menu.dropdown-menu-right li') do - click_link('Milestone') - end + click_button 'Created date' + click_button 'Milestone' visit(issues_dashboard_path(assignee_username: user.username)) - expect(find('.issues-filters a.is-active')).to have_content('Milestone') + expect(page).to have_button 'Milestone' visit(project_issues_path(project)) - expect(find('.issues-filters a.is-active')).to have_content('Milestone') + expect(page).to have_button 'Milestone' visit(issues_group_path(group)) - expect(find('.issues-filters a.is-active')).to have_content('Milestone') + expect(page).to have_button 'Milestone' end it 'sorts by popularity', :js do diff --git a/spec/features/merge_requests/user_sorts_merge_requests_spec.rb b/spec/features/merge_requests/user_sorts_merge_requests_spec.rb index 99473f3b1ea..fba7facaa1f 100644 --- a/spec/features/merge_requests/user_sorts_merge_requests_spec.rb +++ b/spec/features/merge_requests/user_sorts_merge_requests_spec.rb @@ -16,6 +16,8 @@ RSpec.describe 'User sorts merge requests' do let_it_be(:project) { create(:project, :public, group: group) } before do + stub_feature_flags(vue_issues_list: true) + sign_in(user) visit(project_merge_requests_path(project)) @@ -49,7 +51,7 @@ RSpec.describe 'User sorts merge requests' do expect(find('.issues-filters a.is-active')).to have_content('Milestone') end - it 'separates remember sorting with issues' do + it 'separates remember sorting with issues', :js do create(:issue, project: project) find('.filter-dropdown-container .dropdown').click diff --git a/spec/features/projects/jobs/user_browses_jobs_spec.rb b/spec/features/projects/jobs/user_browses_jobs_spec.rb index 3b70d177fce..07b7a54974a 100644 --- a/spec/features/projects/jobs/user_browses_jobs_spec.rb +++ b/spec/features/projects/jobs/user_browses_jobs_spec.rb @@ -19,7 +19,7 @@ RSpec.describe 'User browses jobs' do stub_feature_flags(jobs_table_vue: false) project.add_maintainer(user) project.enable_ci - project.update_attribute(:build_coverage_regex, /Coverage (\d+)%/) + build.update!(coverage_regex: '/Coverage (\d+)%/') sign_in(user) diff --git a/spec/features/projects/settings/pipelines_settings_spec.rb b/spec/features/projects/settings/pipelines_settings_spec.rb index 39c4315bf0f..a64f81430d1 100644 --- a/spec/features/projects/settings/pipelines_settings_spec.rb +++ b/spec/features/projects/settings/pipelines_settings_spec.rb @@ -25,24 +25,6 @@ RSpec.describe "Projects > Settings > Pipelines settings" do context 'for maintainer' do let(:role) { :maintainer } - it 'be allowed to change' do - visit project_settings_ci_cd_path(project) - - fill_in('Test coverage parsing', with: 'coverage_regex') - - page.within '#js-general-pipeline-settings' do - click_on 'Save changes' - end - - expect(page.status_code).to eq(200) - - page.within '#js-general-pipeline-settings' do - expect(page).to have_button('Save changes', disabled: false) - end - - expect(page).to have_field('Test coverage parsing', with: 'coverage_regex') - end - it 'updates auto_cancel_pending_pipelines' do visit project_settings_ci_cd_path(project) diff --git a/spec/features/user_sorts_things_spec.rb b/spec/features/user_sorts_things_spec.rb index fa37d692225..9cff08c7f29 100644 --- a/spec/features/user_sorts_things_spec.rb +++ b/spec/features/user_sorts_things_spec.rb @@ -16,21 +16,24 @@ RSpec.describe "User sorts things" do let_it_be(:merge_request) { create(:merge_request, target_project: project, source_project: project, author: current_user) } before do + stub_feature_flags(vue_issues_list: true) + project.add_developer(current_user) sign_in(current_user) end - it "issues -> project home page -> issues" do + it "issues -> project home page -> issues", :js do sort_option = 'Updated date' visit(project_issues_path(project)) - sort_by(sort_option) + click_button 'Created date' + click_button sort_option visit(project_path(project)) visit(project_issues_path(project)) - expect(find(".issues-filters")).to have_content(sort_option) + expect(page).to have_button(sort_option) end it "merge requests -> dashboard merge requests" do |