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:
authorGitLab Bot <gitlab-bot@gitlab.com>2022-06-30 18:09:03 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2022-06-30 18:09:03 +0300
commite7b262a4c5cf70fed6eb25ba7a0eb1336e6eb639 (patch)
tree4e1037d8fd8d93883e52d1fbd8b542dfc81a0436 /spec/features/incidents
parentb0139a824fba85e5b71e69f2c99d423700ff76cc (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/features/incidents')
-rw-r--r--spec/features/incidents/incident_details_spec.rb77
1 files changed, 39 insertions, 38 deletions
diff --git a/spec/features/incidents/incident_details_spec.rb b/spec/features/incidents/incident_details_spec.rb
index dad3dfd3440..7c24943eb6f 100644
--- a/spec/features/incidents/incident_details_spec.rb
+++ b/spec/features/incidents/incident_details_spec.rb
@@ -6,6 +6,7 @@ RSpec.describe 'Incident details', :js do
let_it_be(:project) { create(:project) }
let_it_be(:developer) { create(:user) }
let_it_be(:incident) { create(:incident, project: project, author: developer, description: 'description') }
+ let_it_be(:issue) { create(:issue, project: project, author: developer, description: 'Issue description') }
let_it_be(:escalation_status) { create(:incident_management_issuable_escalation_status, issue: incident) }
before_all do
@@ -14,23 +15,24 @@ RSpec.describe 'Incident details', :js do
before do
sign_in(developer)
-
- visit project_issues_incident_path(project, incident)
- wait_for_requests
end
context 'when a developer+ displays the incident' do
- it 'shows the incident' do
+ before do
+ visit project_issues_incident_path(project, incident)
+ wait_for_requests
+ end
+
+ it 'shows correct elements on the page', :aggregate_failures do
+ # shows the incident
page.within('.issuable-details') do
expect(find('h1')).to have_content(incident.title)
end
- end
- it 'does not show design management' do
+ # does not show design management
expect(page).not_to have_selector('.js-design-management')
- end
- it 'shows the incident tabs' do
+ # shows the incident tabs
page.within('.issuable-details') do
incident_tabs = find('[data-testid="incident-tabs"]')
@@ -38,9 +40,8 @@ RSpec.describe 'Incident details', :js do
expect(incident_tabs).to have_content('Summary')
expect(incident_tabs).to have_content(incident.description)
end
- end
- it 'shows the right sidebar mounted with type issue' do
+ # shows the right sidebar mounted with type issue
page.within('.layout-page') do
sidebar = find('.right-sidebar')
@@ -51,12 +52,12 @@ RSpec.describe 'Incident details', :js do
end
end
- context 'escalation status' do
+ describe 'escalation status' do
let(:sidebar) { page.find('.right-sidebar') }
let(:widget) { sidebar.find('[data-testid="escalation_status_container"]') }
let(:expected_dropdown_options) { escalation_status.class::STATUSES.keys.take(3).map { |key| key.to_s.titleize } }
- it 'has an interactable escalation status widget' do
+ it 'has an interactable escalation status widget', :aggregate_failures do
expect(current_status).to have_text(escalation_status.status_name.to_s.titleize)
# list the available statuses
@@ -87,41 +88,41 @@ RSpec.describe 'Incident details', :js do
end
end
- context 'when an incident `issue_type` is edited by a signed in user' do
- it 'routes the user to the incident details page when the `issue_type` is set to incident' do
- wait_for_requests
- project_path = "/#{project.full_path}"
- click_button 'Edit title and description'
- wait_for_requests
+ it 'routes the user to the incident details page when the `issue_type` is set to incident' do
+ visit project_issue_path(project, issue)
+ wait_for_requests
+
+ project_path = "/#{project.full_path}"
+ click_button 'Edit title and description'
+ wait_for_requests
- page.within('[data-testid="issuable-form"]') do
- click_button 'Incident'
- click_button 'Issue'
- click_button 'Save changes'
+ page.within('[data-testid="issuable-form"]') do
+ click_button 'Issue'
+ click_button 'Incident'
+ click_button 'Save changes'
- wait_for_requests
+ wait_for_requests
- expect(page).to have_current_path("#{project_path}/-/issues/#{incident.iid}")
- end
+ expect(page).to have_current_path("#{project_path}/-/issues/incident/#{issue.iid}")
end
end
- context 'when incident details are edited by a signed in user' do
- it 'routes the user to the incident details page when the `issue_type` is set to incident' do
- wait_for_requests
- project_path = "/#{project.full_path}"
- click_button 'Edit title and description'
- wait_for_requests
+ it 'routes the user to the issue details page when the `issue_type` is set to issue' do
+ visit project_issues_incident_path(project, incident)
+ wait_for_requests
- page.within('[data-testid="issuable-form"]') do
- click_button 'Incident'
- click_button 'Issue'
- click_button 'Save changes'
+ project_path = "/#{project.full_path}"
+ click_button 'Edit title and description'
+ wait_for_requests
- wait_for_requests
+ page.within('[data-testid="issuable-form"]') do
+ click_button 'Incident'
+ click_button 'Issue'
+ click_button 'Save changes'
- expect(page).to have_current_path("#{project_path}/-/issues/#{incident.iid}")
- end
+ wait_for_requests
+
+ expect(page).to have_current_path("#{project_path}/-/issues/#{incident.iid}")
end
end
end