summaryrefslogtreecommitdiff
path: root/spec/features/issues
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2023-02-20 13:49:51 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2023-02-20 13:49:51 +0000
commit71786ddc8e28fbd3cb3fcc4b3ff15e5962a1c82e (patch)
tree6a2d93ef3fb2d353bb7739e4b57e6541f51cdd71 /spec/features/issues
parenta7253423e3403b8c08f8a161e5937e1488f5f407 (diff)
downloadgitlab-ce-15.9.0-rc42.tar.gz
Add latest changes from gitlab-org/gitlab@15-9-stable-eev15.9.0-rc42
Diffstat (limited to 'spec/features/issues')
-rw-r--r--spec/features/issues/form_spec.rb4
-rw-r--r--spec/features/issues/incident_issue_spec.rb2
-rw-r--r--spec/features/issues/issue_detail_spec.rb4
-rw-r--r--spec/features/issues/issue_sidebar_spec.rb27
-rw-r--r--spec/features/issues/move_spec.rb24
-rw-r--r--spec/features/issues/spam_akismet_issue_creation_spec.rb20
-rw-r--r--spec/features/issues/user_bulk_edits_issues_spec.rb4
-rw-r--r--spec/features/issues/user_creates_issue_spec.rb7
-rw-r--r--spec/features/issues/user_edits_issue_spec.rb4
9 files changed, 47 insertions, 49 deletions
diff --git a/spec/features/issues/form_spec.rb b/spec/features/issues/form_spec.rb
index 2898c97c2e9..585740f7782 100644
--- a/spec/features/issues/form_spec.rb
+++ b/spec/features/issues/form_spec.rb
@@ -353,14 +353,14 @@ RSpec.describe 'New/edit issue', :js, feature_category: :team_planning do
expect(find('#issue_description').value).to match('description from query parameter')
end
- it 'fills the description from the issuable_template query parameter' do
+ it 'fills the description from the issuable_template query parameter', quarantine: 'https://gitlab.com/gitlab-org/gitlab/-/issues/388728' do
visit new_project_issue_path(project, issuable_template: 'test_template')
wait_for_requests
expect(find('#issue_description').value).to match('description from template')
end
- it 'fills the description from the issuable_template and issue[description] query parameters' do
+ it 'fills the description from the issuable_template and issue[description] query parameters', quarantine: 'https://gitlab.com/gitlab-org/gitlab/-/issues/388728' do
visit new_project_issue_path(project, issuable_template: 'test_template', issue: { description: 'description from query parameter' })
wait_for_requests
diff --git a/spec/features/issues/incident_issue_spec.rb b/spec/features/issues/incident_issue_spec.rb
index 2fba1ca9141..41bbd79202f 100644
--- a/spec/features/issues/incident_issue_spec.rb
+++ b/spec/features/issues/incident_issue_spec.rb
@@ -29,7 +29,7 @@ RSpec.describe 'Incident Detail', :js, feature_category: :team_planning do
project.add_developer(user)
sign_in(user)
- visit project_issues_incident_path(project, incident)
+ visit incident_project_issues_path(project, incident)
wait_for_requests
end
diff --git a/spec/features/issues/issue_detail_spec.rb b/spec/features/issues/issue_detail_spec.rb
index 44e9bbad1ba..20a69c61871 100644
--- a/spec/features/issues/issue_detail_spec.rb
+++ b/spec/features/issues/issue_detail_spec.rb
@@ -130,7 +130,7 @@ RSpec.describe 'Issue Detail', :js, feature_category: :team_planning do
page.within('[data-testid="issuable-form"]') do
update_type_select('Issue', 'Incident')
- expect(page).to have_current_path(project_issues_incident_path(project, issue))
+ expect(page).to have_current_path(incident_project_issues_path(project, issue))
end
end
end
@@ -170,7 +170,7 @@ RSpec.describe 'Issue Detail', :js, feature_category: :team_planning do
def update_type_select(from, to)
click_button from
- click_button to
+ find('[data-testid="issue-type-list-item"]', text: to).click
click_button 'Save changes'
wait_for_requests
diff --git a/spec/features/issues/issue_sidebar_spec.rb b/spec/features/issues/issue_sidebar_spec.rb
index fa72acad8c6..686074f7412 100644
--- a/spec/features/issues/issue_sidebar_spec.rb
+++ b/spec/features/issues/issue_sidebar_spec.rb
@@ -4,6 +4,7 @@ require 'spec_helper'
RSpec.describe 'Issue Sidebar', feature_category: :team_planning do
include MobileHelpers
+ include Spec::Support::Helpers::Features::InviteMembersModalHelper
let_it_be(:group) { create(:group, :nested) }
let_it_be(:project) { create(:project, :public, namespace: group) }
@@ -120,11 +121,13 @@ RSpec.describe 'Issue Sidebar', feature_category: :team_planning do
expect(page).to have_link('Invite members')
expect(page).to have_selector('[data-track-action="click_invite_members"]')
expect(page).to have_selector('[data-track-label="edit_assignee"]')
- end
- click_link 'Invite members'
+ click_link 'Invite members'
+ end
- expect(page).to have_content("You're inviting members to the")
+ page.within invite_modal_selector do
+ expect(page).to have_content("You're inviting members to the #{project.name} project")
+ end
end
end
@@ -208,7 +211,7 @@ RSpec.describe 'Issue Sidebar', feature_category: :team_planning do
visit_issue(project, issue)
end
- context 'sidebar', :js do
+ context 'for sidebar', :js do
it 'changes size when the screen size is smaller' do
sidebar_selector = 'aside.right-sidebar.right-sidebar-collapsed'
# Resize the window
@@ -227,25 +230,25 @@ RSpec.describe 'Issue Sidebar', feature_category: :team_planning do
end
end
- context 'editing issue milestone', :js do
+ context 'for editing issue milestone', :js do
it_behaves_like 'milestone sidebar widget'
end
- context 'editing issue due date', :js do
+ context 'for editing issue due date', :js do
it_behaves_like 'date sidebar widget'
end
- context 'editing issue labels', :js do
+ context 'for editing issue labels', :js do
it_behaves_like 'labels sidebar widget'
end
- context 'escalation status', :js do
+ context 'for escalation status', :js do
it 'is not available for default issue type' do
expect(page).not_to have_selector('.block.escalation-status')
end
end
- context 'interacting with collapsed sidebar', :js do
+ context 'when interacting with collapsed sidebar', :js do
collapsed_sidebar_selector = 'aside.right-sidebar.right-sidebar-collapsed'
expanded_sidebar_selector = 'aside.right-sidebar.right-sidebar-expanded'
confidentiality_sidebar_block = '.block.confidentiality'
@@ -300,7 +303,7 @@ RSpec.describe 'Issue Sidebar', feature_category: :team_planning do
expect(page).not_to have_selector('.block.labels .js-sidebar-dropdown-toggle')
end
- context 'sidebar', :js do
+ context 'for sidebar', :js do
it 'finds issue copy forwarding email' do
expect(
find('[data-testid="copy-forward-email"]').text
@@ -308,7 +311,7 @@ RSpec.describe 'Issue Sidebar', feature_category: :team_planning do
end
end
- context 'interacting with collapsed sidebar', :js do
+ context 'when interacting with collapsed sidebar', :js do
collapsed_sidebar_selector = 'aside.right-sidebar.right-sidebar-collapsed'
expanded_sidebar_selector = 'aside.right-sidebar.right-sidebar-expanded'
lock_sidebar_block = '.block.lock'
@@ -334,7 +337,7 @@ RSpec.describe 'Issue Sidebar', feature_category: :team_planning do
end
context 'when not signed in' do
- context 'sidebar', :js do
+ context 'for sidebar', :js do
before do
visit_issue(project, issue)
end
diff --git a/spec/features/issues/move_spec.rb b/spec/features/issues/move_spec.rb
index 72c6e288168..ea68f2266b3 100644
--- a/spec/features/issues/move_spec.rb
+++ b/spec/features/issues/move_spec.rb
@@ -23,7 +23,7 @@ RSpec.describe 'issue move to another project', feature_category: :team_planning
end
it 'moving issue to another project not allowed' do
- expect(page).to have_no_selector('.js-sidebar-move-issue-block')
+ expect(page).to have_no_selector('.js-issuable-move-block')
end
end
@@ -42,10 +42,10 @@ RSpec.describe 'issue move to another project', feature_category: :team_planning
end
it 'moving issue to another project', :js do
- find('.js-move-issue').click
+ click_button _('Move issue')
wait_for_requests
- all('.js-move-issue-dropdown-item')[0].click
- find('.js-move-issue-confirmation-button').click
+ all('.gl-dropdown-item')[0].click
+ click_button _('Move')
expect(page).to have_content("Text with #{cross_reference}#{mr.to_reference}")
expect(page).to have_content("moved from #{cross_reference}#{issue.to_reference}")
@@ -56,11 +56,11 @@ RSpec.describe 'issue move to another project', feature_category: :team_planning
it 'searching project dropdown', :js do
new_project_search.add_reporter(user)
- find('.js-move-issue').click
+ click_button _('Move issue')
wait_for_requests
- page.within '.js-sidebar-move-issue-block' do
- fill_in('sidebar-move-issue-dropdown-search', with: new_project_search.name)
+ page.within '.js-issuable-move-block' do
+ fill_in(_('Search project'), with: new_project_search.name)
expect(page).to have_content(new_project_search.name)
expect(page).not_to have_content(new_project.name)
@@ -76,10 +76,10 @@ RSpec.describe 'issue move to another project', feature_category: :team_planning
end
it 'browsing projects in projects select' do
- find('.js-move-issue').click
+ click_button _('Move issue')
wait_for_requests
- page.within '.js-sidebar-move-issue-block' do
+ page.within '.js-issuable-move-block' do
expect(page).to have_content new_project.full_name
end
end
@@ -115,10 +115,10 @@ RSpec.describe 'issue move to another project', feature_category: :team_planning
visit issue_path(service_desk_issue)
- find('.js-move-issue').click
+ click_button _('Move issue')
wait_for_requests
- find('.js-move-issue-dropdown-item', text: project_title).click
- find('.js-move-issue-confirmation-button').click
+ find('.gl-dropdown-item', text: project_title).click
+ click_button _('Move')
end
it 'shows an alert after being moved' do
diff --git a/spec/features/issues/spam_akismet_issue_creation_spec.rb b/spec/features/issues/spam_akismet_issue_creation_spec.rb
index 7c62f141105..176c26c6d8a 100644
--- a/spec/features/issues/spam_akismet_issue_creation_spec.rb
+++ b/spec/features/issues/spam_akismet_issue_creation_spec.rb
@@ -108,20 +108,20 @@ RSpec.describe 'Spam detection on issue creation', :js, feature_category: :team_
end
end
- shared_context 'when allow_possible_spam feature flag is true' do
+ shared_context 'when allow_possible_spam application setting is true' do
before do
- stub_feature_flags(allow_possible_spam: true)
+ stub_application_setting(allow_possible_spam: true)
end
end
- shared_context 'when allow_possible_spam feature flag is false' do
+ shared_context 'when allow_possible_spam application setting is false' do
before do
- stub_feature_flags(allow_possible_spam: false)
+ stub_application_setting(allow_possible_spam: false)
end
end
describe 'spam handling' do
- # verdict, spam_flagged, captcha_enabled, allow_possible_spam_flag, creates_spam_log
+ # verdict, spam_flagged, captcha_enabled, allow_possible_spam, creates_spam_log
# TODO: Add example for BLOCK_USER verdict when we add support for testing SpamCheck - see https://gitlab.com/groups/gitlab-org/-/epics/5527#lacking-coverage-for-spamcheck-vs-akismet
# DISALLOW, true, false, false, true
# CONDITIONAL_ALLOW, true, true, false, true
@@ -133,7 +133,7 @@ RSpec.describe 'Spam detection on issue creation', :js, feature_category: :team_
context 'DISALLOW: spam_flagged=true, captcha_enabled=true, allow_possible_spam=true' do
include_context 'when spammable is identified as possible spam'
include_context 'when CAPTCHA is enabled'
- include_context 'when allow_possible_spam feature flag is true'
+ include_context 'when allow_possible_spam application setting is true'
it_behaves_like 'allows issue creation without CAPTCHA'
it_behaves_like 'creates a spam_log record'
@@ -142,7 +142,7 @@ RSpec.describe 'Spam detection on issue creation', :js, feature_category: :team_
context 'CONDITIONAL_ALLOW: spam_flagged=true, captcha_enabled=true, allow_possible_spam=false' do
include_context 'when spammable is identified as possible spam'
include_context 'when CAPTCHA is enabled'
- include_context 'when allow_possible_spam feature flag is false'
+ include_context 'when allow_possible_spam application setting is false'
it_behaves_like 'allows issue creation with CAPTCHA'
it_behaves_like 'creates a spam_log record'
@@ -151,7 +151,7 @@ RSpec.describe 'Spam detection on issue creation', :js, feature_category: :team_
context 'OVERRIDE_VIA_ALLOW_POSSIBLE_SPAM: spam_flagged=true, captcha_enabled=true, allow_possible_spam=true' do
include_context 'when spammable is identified as possible spam'
include_context 'when CAPTCHA is enabled'
- include_context 'when allow_possible_spam feature flag is true'
+ include_context 'when allow_possible_spam application setting is true'
it_behaves_like 'allows issue creation without CAPTCHA'
it_behaves_like 'creates a spam_log record'
@@ -160,7 +160,7 @@ RSpec.describe 'Spam detection on issue creation', :js, feature_category: :team_
context 'OVERRIDE_VIA_ALLOW_POSSIBLE_SPAM: spam_flagged=true, captcha_enabled=false, allow_possible_spam=true' do
include_context 'when spammable is identified as possible spam'
include_context 'when CAPTCHA is not enabled'
- include_context 'when allow_possible_spam feature flag is true'
+ include_context 'when allow_possible_spam application setting is true'
it_behaves_like 'allows issue creation without CAPTCHA'
it_behaves_like 'creates a spam_log record'
@@ -169,7 +169,7 @@ RSpec.describe 'Spam detection on issue creation', :js, feature_category: :team_
context 'ALLOW: spam_flagged=false, captcha_enabled=true, allow_possible_spam=false' do
include_context 'when spammable is not identified as possible spam'
include_context 'when CAPTCHA is not enabled'
- include_context 'when allow_possible_spam feature flag is false'
+ include_context 'when allow_possible_spam application setting is false'
it_behaves_like 'allows issue creation without CAPTCHA'
it_behaves_like 'does not create a spam_log record'
diff --git a/spec/features/issues/user_bulk_edits_issues_spec.rb b/spec/features/issues/user_bulk_edits_issues_spec.rb
index fc48bc4baf9..5696bde4069 100644
--- a/spec/features/issues/user_bulk_edits_issues_spec.rb
+++ b/spec/features/issues/user_bulk_edits_issues_spec.rb
@@ -46,7 +46,7 @@ RSpec.describe 'Multiple issue updating from issues#index', :js, feature_categor
click_button 'Edit issues'
check 'Select all'
click_update_assignee_button
- click_link user.username
+ click_button user.username
click_update_issues_button
@@ -64,7 +64,7 @@ RSpec.describe 'Multiple issue updating from issues#index', :js, feature_categor
click_button 'Edit issues'
check 'Select all'
click_update_assignee_button
- click_link 'Unassigned'
+ click_button 'Unassigned'
click_update_issues_button
expect(find('.issue:first-of-type')).not_to have_link "Assigned to #{user.name}"
diff --git a/spec/features/issues/user_creates_issue_spec.rb b/spec/features/issues/user_creates_issue_spec.rb
index df039493cec..c5d0791dc57 100644
--- a/spec/features/issues/user_creates_issue_spec.rb
+++ b/spec/features/issues/user_creates_issue_spec.rb
@@ -157,15 +157,10 @@ RSpec.describe "User creates issue", feature_category: :team_planning do
end
end
- context 'form filled by URL parameters' do
+ context 'form filled by URL parameters', :use_null_store_as_repository_cache do
let(:project) { create(:project, :public, :repository) }
before do
- # With multistore feature flags enabled (using an actual Redis store instead of NullStore),
- # it somehow writes an invalid content to Redis and the specs would fail.
- stub_feature_flags(use_primary_and_secondary_stores_for_repository_cache: false)
- stub_feature_flags(use_primary_store_as_default_for_repository_cache: false)
-
project.repository.create_file(
user,
'.gitlab/issue_templates/bug.md',
diff --git a/spec/features/issues/user_edits_issue_spec.rb b/spec/features/issues/user_edits_issue_spec.rb
index 19b2633969d..bf2af918f39 100644
--- a/spec/features/issues/user_edits_issue_spec.rb
+++ b/spec/features/issues/user_edits_issue_spec.rb
@@ -26,7 +26,7 @@ RSpec.describe "Issues > User edits issue", :js, feature_category: :team_plannin
visit edit_project_issue_path(project, issue)
end
- it "previews content" do
+ it "previews content", quarantine: 'https://gitlab.com/gitlab-org/gitlab/-/issues/391757' do
form = first(".gfm-form")
page.within(form) do
@@ -433,7 +433,7 @@ RSpec.describe "Issues > User edits issue", :js, feature_category: :team_plannin
issue.save!
end
- it 'shows milestone text' do
+ it 'shows milestone text', quarantine: 'https://gitlab.com/gitlab-org/gitlab/-/issues/389287' do
sign_out(:user)
sign_in(guest)