diff options
Diffstat (limited to 'spec/features/clusters/cluster_health_dashboard_spec.rb')
-rw-r--r-- | spec/features/clusters/cluster_health_dashboard_spec.rb | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/spec/features/clusters/cluster_health_dashboard_spec.rb b/spec/features/clusters/cluster_health_dashboard_spec.rb index b557f803a99..e932f8c6b98 100644 --- a/spec/features/clusters/cluster_health_dashboard_spec.rb +++ b/spec/features/clusters/cluster_health_dashboard_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' RSpec.describe 'Cluster Health board', :js, :kubeclient, :use_clean_rails_memory_store_caching, :sidekiq_inline, -feature_category: :kubernetes_management do +feature_category: :deployment_management do include KubernetesHelpers include PrometheusHelpers @@ -13,6 +13,8 @@ feature_category: :kubernetes_management do let_it_be(:cluster_path) { project_cluster_path(clusterable, cluster) } before do + stub_feature_flags(remove_monitor_metrics: false) + clusterable.add_maintainer(current_user) sign_in(current_user) @@ -28,6 +30,24 @@ feature_category: :kubernetes_management do expect(page).to have_css('.cluster-health-graphs') end + context 'feature remove_monitor_metrics enabled' do + before do + stub_feature_flags(remove_monitor_metrics: true) + end + + it 'does not show the cluster health tab' do + visit cluster_path + + expect(page).not_to have_text('Health') + end + + it 'does not show the cluster health section' do + visit project_cluster_path(clusterable, cluster, { tab: 'health' }) + + expect(page).not_to have_text('you must first enable Prometheus in the Integrations tab') + end + end + context 'no prometheus available' do it 'shows enable Prometheus message' do visit cluster_path |