summaryrefslogtreecommitdiff
path: root/spec/views
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2022-01-26 09:14:20 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2022-01-26 09:14:20 +0000
commit30b1000678f33e5b8ae5b4dcbeb2ae5162a2cc5d (patch)
tree2929d8692104f816194e7462e21bcda2c91ed10e /spec/views
parent4b198b6289b1643b6e2571c03a377fe08e6ab504 (diff)
downloadgitlab-ce-30b1000678f33e5b8ae5b4dcbeb2ae5162a2cc5d.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/views')
-rw-r--r--spec/views/shared/issuable/_sidebar.html.haml_spec.rb39
1 files changed, 39 insertions, 0 deletions
diff --git a/spec/views/shared/issuable/_sidebar.html.haml_spec.rb b/spec/views/shared/issuable/_sidebar.html.haml_spec.rb
new file mode 100644
index 00000000000..2097b8890cc
--- /dev/null
+++ b/spec/views/shared/issuable/_sidebar.html.haml_spec.rb
@@ -0,0 +1,39 @@
+# frozen_string_literal: true
+
+require 'spec_helper'
+
+RSpec.describe 'shared/issuable/_sidebar.html.haml' do
+ let_it_be(:user) { create(:user) }
+
+ subject(:rendered) do
+ render 'shared/issuable/sidebar', issuable_sidebar: IssueSerializer.new(current_user: user)
+ .represent(issuable, serializer: 'sidebar'), assignees: []
+ end
+
+ context 'project in a group' do
+ let_it_be(:group) { create(:group) }
+ let_it_be(:project) { create(:project, group: group) }
+ let_it_be(:issue) { create(:issue, project: project) }
+ let_it_be(:incident) { create(:incident, project: project) }
+
+ before do
+ assign(:project, project)
+ end
+
+ context 'issuable that does not support escalations' do
+ let(:issuable) { incident }
+
+ it 'shows escalation policy dropdown' do
+ expect(rendered).to have_css('[data-testid="escalation_status_container"]')
+ end
+ end
+
+ context 'issuable that supports escalations' do
+ let(:issuable) { issue }
+
+ it 'does not show escalation policy dropdown' do
+ expect(rendered).not_to have_css('[data-testid="escalation_status_container"]')
+ end
+ end
+ end
+end