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-03-15 15:07:44 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2022-03-15 15:07:44 +0300
commit6a9ab27963fc1479fe7c78581b942c8dcce322e5 (patch)
tree8d32f4f66efde1b426658a74d0276e5250091ab7 /spec/features/incidents
parent389d5aa505a916b0506b7b73dcc3be342d724976 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/features/incidents')
-rw-r--r--spec/features/incidents/incident_details_spec.rb37
1 files changed, 37 insertions, 0 deletions
diff --git a/spec/features/incidents/incident_details_spec.rb b/spec/features/incidents/incident_details_spec.rb
index dbcd524cad0..dad3dfd3440 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(:escalation_status) { create(:incident_management_issuable_escalation_status, issue: incident) }
before_all do
project.add_developer(developer)
@@ -46,6 +47,42 @@ RSpec.describe 'Incident details', :js do
expect(page).to have_selector('.right-sidebar[data-issuable-type="issue"]')
expect(sidebar).to have_selector('.incident-severity')
expect(sidebar).to have_selector('.milestone')
+ expect(sidebar).to have_selector('[data-testid="escalation_status_container"]')
+ end
+ end
+
+ context '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
+ expect(current_status).to have_text(escalation_status.status_name.to_s.titleize)
+
+ # list the available statuses
+ widget.find('[data-testid="edit-button"]').click
+ expect(dropdown_options.map(&:text)).to eq(expected_dropdown_options)
+ expect(widget).not_to have_selector('#escalation-status-help')
+
+ # update the status
+ select_resolved(dropdown_options)
+ expect(current_status).to have_text('Resolved')
+ expect(escalation_status.reload).to be_resolved
+ end
+
+ private
+
+ def dropdown_options
+ widget.all('[data-testid="status-dropdown-item"]', count: 3)
+ end
+
+ def select_resolved(options)
+ options.last.click
+ wait_for_requests
+ end
+
+ def current_status
+ widget.find('[data-testid="collapsed-content"]')
end
end
end