diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-10-05 16:54:15 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-10-05 16:54:15 +0300 |
commit | be834a25982746ffd85252ff502df42bb88cb9d5 (patch) | |
tree | b4d6a8ba0931e12fac08f05abea33a3b8ec2c8a2 /spec/features/operations_sidebar_link_spec.rb | |
parent | ee925a3597f27e92f83a50937a64068109675b3d (diff) |
Add latest changes from gitlab-org/gitlab@13-5-stable-eev13.5.0-rc32
Diffstat (limited to 'spec/features/operations_sidebar_link_spec.rb')
-rw-r--r-- | spec/features/operations_sidebar_link_spec.rb | 81 |
1 files changed, 81 insertions, 0 deletions
diff --git a/spec/features/operations_sidebar_link_spec.rb b/spec/features/operations_sidebar_link_spec.rb new file mode 100644 index 00000000000..32e2833dafb --- /dev/null +++ b/spec/features/operations_sidebar_link_spec.rb @@ -0,0 +1,81 @@ +# frozen_string_literal: true + +require 'spec_helper' + +RSpec.describe 'Operations dropdown sidebar' do + let_it_be(:project) { create(:project, :repository) } + let(:user) { create(:user) } + + before do + project.add_role(user, role) + sign_in(user) + visit project_issues_path(project) + end + + context 'user has guest role' do + let(:role) { :guest } + + it 'has the correct `Operations` menu items' do + expect(page).to have_link(title: 'Incidents', href: project_incidents_path(project)) + + expect(page).not_to have_link(title: 'Metrics', href: project_metrics_dashboard_path(project)) + expect(page).not_to have_link(title: 'Alerts', href: project_alert_management_index_path(project)) + expect(page).not_to have_link(title: 'Environments', href: project_environments_path(project)) + expect(page).not_to have_link(title: 'Error Tracking', href: project_error_tracking_index_path(project)) + expect(page).not_to have_link(title: 'Product Analytics', href: project_product_analytics_path(project)) + expect(page).not_to have_link(title: 'Serverless', href: project_serverless_functions_path(project)) + expect(page).not_to have_link(title: 'Logs', href: project_logs_path(project)) + expect(page).not_to have_link(title: 'Kubernetes', href: project_clusters_path(project)) + end + end + + context 'user has reporter role' do + let(:role) { :reporter } + + it 'has the correct `Operations` menu items' do + expect(page).to have_link(title: 'Metrics', href: project_metrics_dashboard_path(project)) + expect(page).to have_link(title: 'Incidents', href: project_incidents_path(project)) + expect(page).to have_link(title: 'Environments', href: project_environments_path(project)) + expect(page).to have_link(title: 'Error Tracking', href: project_error_tracking_index_path(project)) + expect(page).to have_link(title: 'Product Analytics', href: project_product_analytics_path(project)) + + expect(page).not_to have_link(title: 'Alerts', href: project_alert_management_index_path(project)) + expect(page).not_to have_link(title: 'Serverless', href: project_serverless_functions_path(project)) + expect(page).not_to have_link(title: 'Logs', href: project_logs_path(project)) + expect(page).not_to have_link(title: 'Kubernetes', href: project_clusters_path(project)) + end + end + + context 'user has developer role' do + let(:role) { :developer } + + it 'has the correct `Operations` menu items' do + expect(page).to have_link(title: 'Metrics', href: project_metrics_dashboard_path(project)) + expect(page).to have_link(title: 'Alerts', href: project_alert_management_index_path(project)) + expect(page).to have_link(title: 'Incidents', href: project_incidents_path(project)) + expect(page).to have_link(title: 'Environments', href: project_environments_path(project)) + expect(page).to have_link(title: 'Error Tracking', href: project_error_tracking_index_path(project)) + expect(page).to have_link(title: 'Product Analytics', href: project_product_analytics_path(project)) + expect(page).to have_link(title: 'Logs', href: project_logs_path(project)) + + expect(page).not_to have_link(title: 'Serverless', href: project_serverless_functions_path(project)) + expect(page).not_to have_link(title: 'Kubernetes', href: project_clusters_path(project)) + end + end + + context 'user has maintainer role' do + let(:role) { :maintainer } + + it 'has the correct `Operations` menu items' do + expect(page).to have_link(title: 'Metrics', href: project_metrics_dashboard_path(project)) + expect(page).to have_link(title: 'Alerts', href: project_alert_management_index_path(project)) + expect(page).to have_link(title: 'Incidents', href: project_incidents_path(project)) + expect(page).to have_link(title: 'Environments', href: project_environments_path(project)) + expect(page).to have_link(title: 'Error Tracking', href: project_error_tracking_index_path(project)) + expect(page).to have_link(title: 'Product Analytics', href: project_product_analytics_path(project)) + expect(page).to have_link(title: 'Serverless', href: project_serverless_functions_path(project)) + expect(page).to have_link(title: 'Logs', href: project_logs_path(project)) + expect(page).to have_link(title: 'Kubernetes', href: project_clusters_path(project)) + end + end +end |