Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'spec/features/issues')
-rw-r--r--spec/features/issues/filtered_search/dropdown_assignee_spec.rb28
-rw-r--r--spec/features/issues/filtered_search/visual_tokens_spec.rb4
-rw-r--r--spec/features/issues/form_spec.rb85
-rw-r--r--spec/features/issues/issue_state_spec.rb66
-rw-r--r--spec/features/issues/move_spec.rb2
-rw-r--r--spec/features/issues/note_polling_spec.rb16
-rw-r--r--spec/features/issues/service_desk_spec.rb6
-rw-r--r--spec/features/issues/todo_spec.rb2
-rw-r--r--spec/features/issues/user_creates_issue_spec.rb2
-rw-r--r--spec/features/issues/user_sees_live_update_spec.rb22
-rw-r--r--spec/features/issues/user_uses_quick_actions_spec.rb4
11 files changed, 106 insertions, 131 deletions
diff --git a/spec/features/issues/filtered_search/dropdown_assignee_spec.rb b/spec/features/issues/filtered_search/dropdown_assignee_spec.rb
index 0a06a052bc2..0c5b33c2530 100644
--- a/spec/features/issues/filtered_search/dropdown_assignee_spec.rb
+++ b/spec/features/issues/filtered_search/dropdown_assignee_spec.rb
@@ -113,33 +113,5 @@ RSpec.describe 'Dropdown assignee', :js, feature_category: :team_planning do
expect(page).to have_text invited_to_group_group_user.name
expect(page).not_to have_text subsubgroup_user.name
end
-
- context 'when new_graphql_users_autocomplete is disabled' do
- before do
- stub_feature_flags(new_graphql_users_autocomplete: false)
- end
-
- it 'shows inherited, direct, and invited group members but not descendent members', :aggregate_failures do
- visit issues_group_path(subgroup)
-
- select_tokens 'Assignee', '='
-
- expect(page).to have_text group_user.name
- expect(page).to have_text subgroup_user.name
- expect(page).to have_text invited_to_group_group_user.name
- expect(page).not_to have_text subsubgroup_user.name
- expect(page).not_to have_text invited_to_project_group_user.name
-
- visit project_issues_path(subgroup_project)
-
- select_tokens 'Assignee', '='
-
- expect(page).to have_text group_user.name
- expect(page).to have_text subgroup_user.name
- expect(page).to have_text invited_to_project_group_user.name
- expect(page).to have_text invited_to_group_group_user.name
- expect(page).not_to have_text subsubgroup_user.name
- end
- end
end
end
diff --git a/spec/features/issues/filtered_search/visual_tokens_spec.rb b/spec/features/issues/filtered_search/visual_tokens_spec.rb
index 3031b20eb7c..e51c82081ff 100644
--- a/spec/features/issues/filtered_search/visual_tokens_spec.rb
+++ b/spec/features/issues/filtered_search/visual_tokens_spec.rb
@@ -6,8 +6,8 @@ RSpec.describe 'Visual tokens', :js, feature_category: :team_planning do
include FilteredSearchHelpers
let_it_be(:project) { create(:project) }
- let_it_be(:user) { create(:user, name: 'administrator', username: 'root') }
- let_it_be(:user_rock) { create(:user, name: 'The Rock', username: 'rock') }
+ let_it_be(:user) { create(:user, :no_super_sidebar, name: 'administrator', username: 'root') }
+ let_it_be(:user_rock) { create(:user, :no_super_sidebar, name: 'The Rock', username: 'rock') }
let_it_be(:milestone_nine) { create(:milestone, title: '9.0', project: project) }
let_it_be(:milestone_ten) { create(:milestone, title: '10.0', project: project) }
let_it_be(:label) { create(:label, project: project, title: 'abc') }
diff --git a/spec/features/issues/form_spec.rb b/spec/features/issues/form_spec.rb
index 5f7a4f26a98..ed2c712feb1 100644
--- a/spec/features/issues/form_spec.rb
+++ b/spec/features/issues/form_spec.rb
@@ -8,14 +8,13 @@ RSpec.describe 'New/edit issue', :js, feature_category: :team_planning do
include ContentEditorHelpers
let_it_be(:project) { create(:project, :repository) }
- let_it_be(:user) { create(:user) }
- let_it_be(:user2) { create(:user) }
- let_it_be(:guest) { create(:user) }
+ let_it_be(:user) { create(:user, :no_super_sidebar) }
+ let_it_be(:user2) { create(:user, :no_super_sidebar) }
+ let_it_be(:guest) { create(:user, :no_super_sidebar) }
let_it_be(:milestone) { create(:milestone, project: project) }
let_it_be(:label) { create(:label, project: project) }
let_it_be(:label2) { create(:label, project: project) }
let_it_be(:issue) { create(:issue, project: project, assignees: [user], milestone: milestone) }
- let_it_be(:issue2) { create(:issue, project: project, assignees: [user], milestone: milestone) }
let_it_be(:confidential_issue) { create(:issue, project: project, assignees: [user], milestone: milestone, confidential: true) }
let(:current_user) { user }
@@ -666,69 +665,59 @@ RSpec.describe 'New/edit issue', :js, feature_category: :team_planning do
end
end
- describe 'inline edit' do
- context 'within issue 1' do
- before do
- visit project_issue_path(project, issue)
- wait_for_requests
- end
+ describe 'editing an issue by hotkey' do
+ let_it_be(:issue2) { create(:issue, project: project) }
- it 'opens inline edit form with shortcut' do
- find('body').send_keys('e')
+ before do
+ visit project_issue_path(project, issue2)
+ end
- expect(page).to have_selector('.detail-page-description form')
- end
+ it 'opens inline edit form with shortcut' do
+ find('body').send_keys('e')
- describe 'when user has made no changes' do
- it 'let user leave the page without warnings' do
- expected_content = 'Issue created'
- expect(page).to have_content(expected_content)
+ expect(page).to have_selector('.detail-page-description form')
+ end
- find('body').send_keys('e')
+ context 'when user has made no changes' do
+ it 'let user leave the page without warnings' do
+ expected_content = 'Issue created'
+ expect(page).to have_content(expected_content)
- click_link 'Boards'
+ find('body').send_keys('e')
- expect(page).not_to have_content(expected_content)
- end
- end
+ click_link 'Boards'
- describe 'when user has made changes' do
- it 'shows a warning and can stay on page', quarantine: 'https://gitlab.com/gitlab-org/gitlab/-/issues/397683' do
- content = 'new issue content'
+ expect(page).not_to have_content(expected_content)
+ end
+ end
- find('body').send_keys('e')
- fill_in 'issue-description', with: content
+ context 'when user has made changes' do
+ it 'shows a warning and can stay on page' do
+ content = 'new issue content'
- click_link 'Boards'
+ find('body').send_keys('e')
+ fill_in 'issue-description', with: content
+ click_link 'Boards' do
page.driver.browser.switch_to.alert.dismiss
-
- click_button 'Save changes'
- wait_for_requests
-
- expect(page).to have_content(content)
end
- end
- end
- context 'within issue 2' do
- before do
- visit project_issue_path(project, issue2)
+ click_button 'Save changes'
wait_for_requests
- end
- describe 'when user has made changes' do
- it 'shows a warning and can leave page', quarantine: 'https://gitlab.com/gitlab-org/gitlab/-/issues/410497' do
- content = 'new issue content'
- find('body').send_keys('e')
- fill_in 'issue-description', with: content
+ expect(page).to have_content(content)
+ end
- click_link 'Boards'
+ it 'shows a warning and can leave page' do
+ content = 'new issue content'
+ find('body').send_keys('e')
+ fill_in 'issue-description', with: content
+ click_link 'Boards' do
page.driver.browser.switch_to.alert.accept
-
- expect(page).not_to have_content(content)
end
+
+ expect(page).not_to have_content(content)
end
end
end
diff --git a/spec/features/issues/issue_state_spec.rb b/spec/features/issues/issue_state_spec.rb
index 758dafccb86..2a8b33183bb 100644
--- a/spec/features/issues/issue_state_spec.rb
+++ b/spec/features/issues/issue_state_spec.rb
@@ -3,53 +3,71 @@
require 'spec_helper'
RSpec.describe 'issue state', :js, feature_category: :team_planning do
- let_it_be(:project) { create(:project) }
+ include CookieHelper
+
+ let_it_be(:group) { create(:group) }
+ let_it_be(:project) { create(:project, group: group) }
let_it_be(:user) { create(:user) }
before do
project.add_developer(user)
sign_in(user)
+ set_cookie('new-actions-popover-viewed', 'true')
end
shared_examples 'issue closed' do |selector|
it 'can close an issue' do
- wait_for_requests
+ expect(page).to have_selector('[data-testid="issue-state-badge"]')
- expect(find('.status-box')).to have_content 'Open'
+ expect(find('[data-testid="issue-state-badge"]')).to have_content 'Open'
within selector do
click_button 'Close issue'
wait_for_requests
end
- expect(find('.status-box')).to have_content 'Closed'
+ expect(find('[data-testid="issue-state-badge"]')).to have_content 'Closed'
end
end
shared_examples 'issue reopened' do |selector|
it 'can reopen an issue' do
- wait_for_requests
+ expect(page).to have_selector('[data-testid="issue-state-badge"]')
- expect(find('.status-box')).to have_content 'Closed'
+ expect(find('[data-testid="issue-state-badge"]')).to have_content 'Closed'
within selector do
click_button 'Reopen issue'
wait_for_requests
end
- expect(find('.status-box')).to have_content 'Open'
+ expect(find('[data-testid="issue-state-badge"]')).to have_content 'Open'
end
end
- describe 'when open', quarantine: 'https://gitlab.com/gitlab-org/gitlab/-/issues/297348' do
+ describe 'when open' do
context 'when clicking the top `Close issue` button', :aggregate_failures do
- let(:open_issue) { create(:issue, project: project) }
+ context 'when move_close_into_dropdown FF is disabled' do
+ let(:open_issue) { create(:issue, project: project) }
- before do
- visit project_issue_path(project, open_issue)
+ before do
+ stub_feature_flags(move_close_into_dropdown: false)
+ visit project_issue_path(project, open_issue)
+ end
+
+ it_behaves_like 'issue closed', '.detail-page-header-actions'
end
- it_behaves_like 'issue closed', '.detail-page-header'
+ context 'when move_close_into_dropdown FF is enabled' do
+ let(:open_issue) { create(:issue, project: project) }
+
+ before do
+ visit project_issue_path(project, open_issue)
+ find('#new-actions-header-dropdown > button').click
+ end
+
+ it_behaves_like 'issue closed', '.dropdown-menu-right'
+ end
end
context 'when clicking the bottom `Close issue` button', :aggregate_failures do
@@ -63,15 +81,29 @@ RSpec.describe 'issue state', :js, feature_category: :team_planning do
end
end
- describe 'when closed', quarantine: 'https://gitlab.com/gitlab-org/gitlab/-/issues/297201' do
+ describe 'when closed' do
context 'when clicking the top `Reopen issue` button', :aggregate_failures do
- let(:closed_issue) { create(:issue, project: project, state: 'closed') }
+ context 'when move_close_into_dropdown FF is disabled' do
+ let(:closed_issue) { create(:issue, project: project, state: 'closed', author: user) }
- before do
- visit project_issue_path(project, closed_issue)
+ before do
+ stub_feature_flags(move_close_into_dropdown: false)
+ visit project_issue_path(project, closed_issue)
+ end
+
+ it_behaves_like 'issue reopened', '.detail-page-header-actions'
end
- it_behaves_like 'issue reopened', '.detail-page-header'
+ context 'when move_close_into_dropdown FF is enabled' do
+ let(:closed_issue) { create(:issue, project: project, state: 'closed', author: user) }
+
+ before do
+ visit project_issue_path(project, closed_issue)
+ find('#new-actions-header-dropdown > button').click
+ end
+
+ it_behaves_like 'issue reopened', '.dropdown-menu-right'
+ end
end
context 'when clicking the bottom `Reopen issue` button', :aggregate_failures do
diff --git a/spec/features/issues/move_spec.rb b/spec/features/issues/move_spec.rb
index 4512e88ae72..a6ed0b52e7d 100644
--- a/spec/features/issues/move_spec.rb
+++ b/spec/features/issues/move_spec.rb
@@ -103,7 +103,7 @@ RSpec.describe 'issue move to another project', feature_category: :team_planning
let(:namespace) { create(:namespace) }
let(:regular_project) { create(:project, title: project_title, service_desk_enabled: false) }
let(:service_desk_project) { build(:project, :private, namespace: namespace, service_desk_enabled: true) }
- let(:service_desk_issue) { create(:issue, project: service_desk_project, author: ::User.support_bot) }
+ let(:service_desk_issue) { create(:issue, project: service_desk_project, author: ::Users::Internal.support_bot) }
before do
allow(Gitlab::Email::IncomingEmail).to receive(:enabled?).and_return(true)
diff --git a/spec/features/issues/note_polling_spec.rb b/spec/features/issues/note_polling_spec.rb
index a390dca6822..293b6c53eb5 100644
--- a/spec/features/issues/note_polling_spec.rb
+++ b/spec/features/issues/note_polling_spec.rb
@@ -19,22 +19,6 @@ RSpec.describe 'Issue notes polling', :js, feature_category: :team_planning do
expect(page).to have_selector("#note_#{note.id}", text: 'Looks good!')
end
-
- context 'when action_cable_notes is disabled' do
- before do
- stub_feature_flags(action_cable_notes: false)
- end
-
- it 'displays the new comment' do
- visit project_issue_path(project, issue)
- close_rich_text_promo_popover_if_present
-
- note = create(:note, noteable: issue, project: project, note: 'Looks good!')
- wait_for_requests
-
- expect(page).to have_selector("#note_#{note.id}", text: 'Looks good!')
- end
- end
end
describe 'updates' do
diff --git a/spec/features/issues/service_desk_spec.rb b/spec/features/issues/service_desk_spec.rb
index 1b99c8b39d3..120b4ddb6e1 100644
--- a/spec/features/issues/service_desk_spec.rb
+++ b/spec/features/issues/service_desk_spec.rb
@@ -5,8 +5,8 @@ require 'spec_helper'
RSpec.describe 'Service Desk Issue Tracker', :js, feature_category: :service_desk do
let(:project) { create(:project, :private, service_desk_enabled: true) }
- let_it_be(:user) { create(:user) }
- let_it_be(:support_bot) { User.support_bot }
+ let_it_be(:user) { create(:user, :no_super_sidebar) }
+ let_it_be(:support_bot) { Users::Internal.support_bot }
before do
# The following two conditions equate to Gitlab::ServiceDesk.supported == true
@@ -252,7 +252,7 @@ RSpec.describe 'Service Desk Issue Tracker', :js, feature_category: :service_des
end
it 'shows service_desk_reply_to in issues list' do
- expect(page).to have_text('by GitLab Support Bot')
+ expect(page).to have_text('by service.desk@example.com via GitLab Support Bot')
end
end
end
diff --git a/spec/features/issues/todo_spec.rb b/spec/features/issues/todo_spec.rb
index 2c537cefa5e..c503c18be8d 100644
--- a/spec/features/issues/todo_spec.rb
+++ b/spec/features/issues/todo_spec.rb
@@ -5,7 +5,7 @@ require 'spec_helper'
RSpec.describe 'Manually create a todo item from issue', :js, feature_category: :team_planning do
let!(:project) { create(:project) }
let!(:issue) { create(:issue, project: project) }
- let!(:user) { create(:user) }
+ let!(:user) { create(:user, :no_super_sidebar) }
before do
project.add_maintainer(user)
diff --git a/spec/features/issues/user_creates_issue_spec.rb b/spec/features/issues/user_creates_issue_spec.rb
index 76b07d903bc..857cb1f39a2 100644
--- a/spec/features/issues/user_creates_issue_spec.rb
+++ b/spec/features/issues/user_creates_issue_spec.rb
@@ -16,7 +16,7 @@ RSpec.describe "User creates issue", feature_category: :team_planning do
sign_out(:user)
end
- it "redirects to signin then back to new issue after signin", :js, quarantine: 'https://gitlab.com/gitlab-org/quality/engineering-productivity/master-broken-incidents/-/issues/1486' 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_sees_live_update_spec.rb b/spec/features/issues/user_sees_live_update_spec.rb
index 860603ad546..0822542ca02 100644
--- a/spec/features/issues/user_sees_live_update_spec.rb
+++ b/spec/features/issues/user_sees_live_update_spec.rb
@@ -19,34 +19,32 @@ RSpec.describe 'Issues > User sees live update', :js, feature_category: :team_pl
expect(page).to have_text("new title")
issue.update!(title: "updated title")
-
wait_for_requests
+
expect(page).to have_text("updated title")
end
end
describe 'confidential issue#show' do
- it 'shows confidential sibebar information as confidential and can be turned off', quarantine: 'https://gitlab.com/gitlab-org/gitlab/-/issues/254644' do
+ it 'shows confidential sidebar information as confidential and can be turned off' do
issue = create(:issue, :confidential, project: project)
visit project_issue_path(project, issue)
- expect(page).to have_css('.issuable-note-warning')
- expect(find('.issuable-sidebar-item.confidentiality')).to have_css('.is-active')
- expect(find('.issuable-sidebar-item.confidentiality')).not_to have_css('.not-active')
-
- find('.confidential-edit').click
- expect(page).to have_css('.sidebar-item-warning-message')
+ expect(page).to have_text('This is a confidential issue. People without permission will never get a notification.')
- within('.sidebar-item-warning-message') do
- find('[data-testid="confidential-toggle"]').click
+ within '.block.confidentiality' do
+ click_button 'Edit'
end
- wait_for_requests
+ expect(page).to have_text('You are going to turn off the confidentiality. This means everyone will be able to see and leave a comment on this issue.')
+
+ click_button 'Turn off'
visit project_issue_path(project, issue)
- expect(page).not_to have_css('.is-active')
+ expect(page).not_to have_css('.gl-badge', text: 'Confidential')
+ expect(page).not_to have_text('This is a confidential issue. People without permission will never get a notification.')
end
end
end
diff --git a/spec/features/issues/user_uses_quick_actions_spec.rb b/spec/features/issues/user_uses_quick_actions_spec.rb
index dc149ccc698..c15716243ae 100644
--- a/spec/features/issues/user_uses_quick_actions_spec.rb
+++ b/spec/features/issues/user_uses_quick_actions_spec.rb
@@ -13,7 +13,7 @@ RSpec.describe 'Issues > User uses quick actions', :js, feature_category: :team_
context "issuable common quick actions" do
let(:new_url_opts) { {} }
- let(:maintainer) { create(:user) }
+ let(:maintainer) { create(:user, :no_super_sidebar) }
let(:project) { create(:project, :public) }
let!(:label_bug) { create(:label, project: project, title: 'bug') }
let!(:label_feature) { create(:label, project: project, title: 'feature') }
@@ -26,7 +26,7 @@ RSpec.describe 'Issues > User uses quick actions', :js, feature_category: :team_
end
describe 'issue-only commands' do
- let(:user) { create(:user) }
+ let(:user) { create(:user, :no_super_sidebar) }
let(:project) { create(:project, :public, :repository) }
let(:issue) { create(:issue, project: project, due_date: Date.new(2016, 8, 28)) }