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.rb21
1 files changed, 17 insertions, 4 deletions
diff --git a/spec/features/incidents/incident_details_spec.rb b/spec/features/incidents/incident_details_spec.rb
index e1167285464..709919d0196 100644
--- a/spec/features/incidents/incident_details_spec.rb
+++ b/spec/features/incidents/incident_details_spec.rb
@@ -3,11 +3,16 @@
require 'spec_helper'
RSpec.describe 'Incident details', :js, feature_category: :incident_management do
+ include MergeRequestDiffHelpers
+
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) }
+ let_it_be(:confidential_incident) do
+ create(:incident, confidential: true, project: project, author: developer, description: 'Confidential')
+ end
before_all do
project.add_developer(developer)
@@ -19,7 +24,7 @@ RSpec.describe 'Incident details', :js, feature_category: :incident_management d
context 'when a developer+ displays the incident' do
before do
- visit project_issues_incident_path(project, incident)
+ visit incident_project_issues_path(project, incident)
wait_for_requests
end
@@ -98,7 +103,7 @@ RSpec.describe 'Incident details', :js, feature_category: :incident_management d
page.within('[data-testid="issuable-form"]') do
click_button 'Issue'
- click_button 'Incident'
+ find('[data-testid="issue-type-list-item"]', text: 'Incident').click
click_button 'Save changes'
wait_for_requests
@@ -108,7 +113,7 @@ RSpec.describe 'Incident details', :js, feature_category: :incident_management d
end
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)
+ visit incident_project_issues_path(project, incident)
wait_for_requests
project_path = "/#{project.full_path}"
@@ -117,7 +122,7 @@ RSpec.describe 'Incident details', :js, feature_category: :incident_management d
page.within('[data-testid="issuable-form"]') do
click_button 'Incident'
- click_button 'Issue'
+ find('[data-testid="issue-type-list-item"]', text: 'Issue').click
click_button 'Save changes'
wait_for_requests
@@ -125,4 +130,12 @@ RSpec.describe 'Incident details', :js, feature_category: :incident_management d
expect(page).to have_current_path("#{project_path}/-/issues/#{incident.iid}")
end
end
+
+ it 'displays the confidential badge on the sticky header when the incident is confidential' do
+ visit incident_project_issues_path(project, confidential_incident)
+ wait_for_requests
+
+ sticky_header = find_by_scrolling('[data-testid=issue-sticky-header]')
+ expect(sticky_header.find('[data-testid=confidential]')).to be_present
+ end
end