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/incidents/incident_details_spec.rb')
-rw-r--r--spec/features/incidents/incident_details_spec.rb38
1 files changed, 38 insertions, 0 deletions
diff --git a/spec/features/incidents/incident_details_spec.rb b/spec/features/incidents/incident_details_spec.rb
index 96f8cf0062c..b704a0515c8 100644
--- a/spec/features/incidents/incident_details_spec.rb
+++ b/spec/features/incidents/incident_details_spec.rb
@@ -49,4 +49,42 @@ RSpec.describe 'Incident details', :js do
end
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
+
+ page.within('[data-testid="issuable-form"]') do
+ click_button 'Incident'
+ click_button 'Issue'
+ click_button 'Save changes'
+
+ wait_for_requests
+
+ expect(page).to have_current_path("#{project_path}/-/issues/#{incident.iid}")
+ end
+ 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
+
+ page.within('[data-testid="issuable-form"]') do
+ click_button 'Incident'
+ click_button 'Issue'
+ click_button 'Save changes'
+
+ wait_for_requests
+
+ expect(page).to have_current_path("#{project_path}/-/issues/#{incident.iid}")
+ end
+ end
+ end
end