summaryrefslogtreecommitdiff
path: root/spec/features/user_can_display_performance_bar_spec.rb
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2021-02-23 09:14:52 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2021-02-23 09:14:52 +0000
commit347bf09d6ecf4871da234c06ca8ee541e27b5105 (patch)
tree2ad6943e0c681c22acc8850d1debc6a983b0e006 /spec/features/user_can_display_performance_bar_spec.rb
parent0a51be0866d33273070f535257626a9eb2e10700 (diff)
downloadgitlab-ce-e6fb969a9e2eb526d0c033422b3e6242fd488574.tar.gz
Add latest changes from gitlab-org/gitlab@13-10-stable-eev13.10.0-rc20210223090520
Diffstat (limited to 'spec/features/user_can_display_performance_bar_spec.rb')
-rw-r--r--spec/features/user_can_display_performance_bar_spec.rb24
1 files changed, 24 insertions, 0 deletions
diff --git a/spec/features/user_can_display_performance_bar_spec.rb b/spec/features/user_can_display_performance_bar_spec.rb
index 9c67523f88f..b8f41925156 100644
--- a/spec/features/user_can_display_performance_bar_spec.rb
+++ b/spec/features/user_can_display_performance_bar_spec.rb
@@ -49,6 +49,10 @@ RSpec.describe 'User can display performance bar', :js do
let(:group) { create(:group) }
+ before do
+ allow(GitlabPerformanceBarStatsWorker).to receive(:perform_in)
+ end
+
context 'when user is logged-out' do
before do
visit root_path
@@ -97,6 +101,26 @@ RSpec.describe 'User can display performance bar', :js do
it_behaves_like 'performance bar is enabled by default in development'
it_behaves_like 'performance bar can be displayed'
+
+ it 'does not show Stats link by default' do
+ find('body').native.send_keys('pb')
+
+ expect(page).not_to have_link('Stats', visible: :all)
+ end
+
+ context 'when GITLAB_PERFORMANCE_BAR_STATS_URL environment variable is set' do
+ let(:stats_url) { 'https://log.gprd.gitlab.net/app/dashboards#/view/' }
+
+ before do
+ stub_env('GITLAB_PERFORMANCE_BAR_STATS_URL', stats_url)
+ end
+
+ it 'shows Stats link' do
+ find('body').native.send_keys('pb')
+
+ expect(page).to have_link('Stats', href: stats_url, visible: :all)
+ end
+ end
end
end
end