summaryrefslogtreecommitdiff
path: root/spec/features/admin/admin_dev_ops_reports_spec.rb
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2022-04-20 10:00:54 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2022-04-20 10:00:54 +0000
commit3cccd102ba543e02725d247893729e5c73b38295 (patch)
treef36a04ec38517f5deaaacb5acc7d949688d1e187 /spec/features/admin/admin_dev_ops_reports_spec.rb
parent205943281328046ef7b4528031b90fbda70c75ac (diff)
downloadgitlab-ce-3cccd102ba543e02725d247893729e5c73b38295.tar.gz
Add latest changes from gitlab-org/gitlab@14-10-stable-eev14.10.0-rc42
Diffstat (limited to 'spec/features/admin/admin_dev_ops_reports_spec.rb')
-rw-r--r--spec/features/admin/admin_dev_ops_reports_spec.rb68
1 files changed, 68 insertions, 0 deletions
diff --git a/spec/features/admin/admin_dev_ops_reports_spec.rb b/spec/features/admin/admin_dev_ops_reports_spec.rb
new file mode 100644
index 00000000000..bf32819cb52
--- /dev/null
+++ b/spec/features/admin/admin_dev_ops_reports_spec.rb
@@ -0,0 +1,68 @@
+# frozen_string_literal: true
+
+require 'spec_helper'
+
+RSpec.describe 'DevOps Report page', :js do
+ before do
+ admin = create(:admin)
+ sign_in(admin)
+ gitlab_enable_admin_mode_sign_in(admin)
+ end
+
+ context 'with devops_adoption feature flag disabled' do
+ before do
+ stub_feature_flags(devops_adoption: false)
+ end
+
+ it 'has dismissable intro callout' do
+ visit admin_dev_ops_reports_path
+
+ expect(page).to have_content 'Introducing Your DevOps Report'
+
+ page.within(find('[data-testid="devops-score-container"]')) do
+ find('[data-testid="close-icon"]').click
+ end
+
+ expect(page).not_to have_content 'Introducing Your DevOps Report'
+ end
+
+ context 'when usage ping is disabled' do
+ before do
+ stub_application_setting(usage_ping_enabled: false)
+ end
+
+ it 'shows empty state' do
+ visit admin_dev_ops_reports_path
+
+ expect(page).to have_text('Service ping is off')
+ end
+
+ it 'hides the intro callout' do
+ visit admin_dev_ops_reports_path
+
+ expect(page).not_to have_content 'Introducing Your DevOps Report'
+ end
+ end
+
+ context 'when there is no data to display' do
+ it 'shows empty state' do
+ stub_application_setting(usage_ping_enabled: true)
+
+ visit admin_dev_ops_reports_path
+
+ expect(page).to have_content('Data is still calculating')
+ end
+ end
+
+ context 'when there is data to display' do
+ it 'shows the DevOps Score app' do
+ stub_application_setting(usage_ping_enabled: true)
+ create(:dev_ops_report_metric)
+
+ visit admin_dev_ops_reports_path
+
+ expect(page).to have_selector('[data-testid="devops-score-app"]')
+ end
+ end
+ end
+end