debian-mirror-gitlab/spec/features/projects/navbar_spec.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

115 lines
2.6 KiB
Ruby
Raw Normal View History

2020-03-13 15:44:24 +05:30
# frozen_string_literal: true
require 'spec_helper'
2023-03-17 16:20:25 +05:30
RSpec.describe 'Project navbar', :with_license, feature_category: :projects do
2020-04-22 19:07:51 +05:30
include NavbarStructureHelper
include WaitForRequests
2020-03-13 15:44:24 +05:30
2020-04-22 19:07:51 +05:30
include_context 'project navbar structure'
2020-03-13 15:44:24 +05:30
2020-04-22 19:07:51 +05:30
let_it_be(:project) { create(:project, :repository) }
2020-04-08 14:13:33 +05:30
2022-04-04 11:22:00 +05:30
let(:user) { project.first_owner }
2020-10-24 23:57:45 +05:30
2021-06-08 01:23:25 +05:30
before do
2020-04-08 14:13:33 +05:30
sign_in(user)
2023-03-17 16:20:25 +05:30
stub_feature_flags(show_pages_in_deployments_menu: false)
2021-09-30 23:02:18 +05:30
stub_config(registry: { enabled: false })
2022-05-07 20:08:51 +05:30
stub_feature_flags(harbor_registry_integration: false)
2023-06-20 00:43:36 +05:30
stub_feature_flags(ml_experiment_tracking: false)
2022-07-16 23:28:13 +05:30
insert_package_nav(_('Deployments'))
2021-09-30 23:02:18 +05:30
insert_infrastructure_registry_nav
2021-11-18 22:05:49 +05:30
insert_infrastructure_google_cloud_nav
2023-05-27 22:25:52 +05:30
insert_infrastructure_aws_nav
2021-09-30 23:02:18 +05:30
end
2021-09-04 01:27:46 +05:30
2021-09-30 23:02:18 +05:30
it_behaves_like 'verified navigation bar' do
2020-04-08 14:13:33 +05:30
before do
2021-09-30 23:02:18 +05:30
visit project_path(project)
2020-03-13 15:44:24 +05:30
end
2021-09-30 23:02:18 +05:30
end
2020-04-08 14:13:33 +05:30
2021-09-30 23:02:18 +05:30
context 'when value stream is available' do
before do
visit project_path(project)
2020-04-22 19:07:51 +05:30
end
2020-04-08 14:13:33 +05:30
2021-09-30 23:02:18 +05:30
it 'redirects to value stream when Analytics item is clicked' do
page.within('.sidebar-top-level-items') do
find('.shortcuts-analytics').click
2020-04-08 14:13:33 +05:30
end
2021-09-30 23:02:18 +05:30
wait_for_requests
2020-04-22 19:07:51 +05:30
2021-09-30 23:02:18 +05:30
expect(page).to have_current_path(project_cycle_analytics_path(project))
2021-06-08 01:23:25 +05:30
end
2020-04-08 14:13:33 +05:30
end
2020-05-24 23:13:21 +05:30
2021-09-30 23:02:18 +05:30
context 'when pages are available' do
before do
stub_config(pages: { enabled: true })
2021-06-08 01:23:25 +05:30
2021-09-30 23:02:18 +05:30
insert_after_sub_nav_item(
2022-10-11 01:57:18 +05:30
_('Packages and registries'),
2021-09-30 23:02:18 +05:30
within: _('Settings'),
new_sub_nav_item_name: _('Pages')
)
2021-06-08 01:23:25 +05:30
2021-09-30 23:02:18 +05:30
visit project_path(project)
2021-06-08 01:23:25 +05:30
end
2021-09-30 23:02:18 +05:30
it_behaves_like 'verified navigation bar'
end
2021-06-08 01:23:25 +05:30
2022-08-13 15:12:31 +05:30
context 'when package registry is available' do
before do
stub_config(packages: { enabled: true })
visit project_path(project)
end
it_behaves_like 'verified navigation bar'
end
2021-09-30 23:02:18 +05:30
context 'when container registry is available' do
2020-05-24 23:13:21 +05:30
before do
stub_config(registry: { enabled: true })
2021-09-30 23:02:18 +05:30
2021-04-29 21:17:54 +05:30
insert_container_nav
2020-10-24 23:57:45 +05:30
2020-05-24 23:13:21 +05:30
visit project_path(project)
end
it_behaves_like 'verified navigation bar'
end
2022-05-07 20:08:51 +05:30
context 'when harbor registry is available' do
2022-10-11 01:57:18 +05:30
let_it_be(:harbor_integration) { create(:harbor_integration, project: project) }
2022-05-07 20:08:51 +05:30
before do
stub_feature_flags(harbor_registry_integration: true)
2023-06-20 00:43:36 +05:30
insert_harbor_registry_nav(_('Terraform modules'))
visit project_path(project)
end
it_behaves_like 'verified navigation bar'
end
context 'when models experiments is available' do
before do
stub_feature_flags(ml_experiment_tracking: true)
insert_model_experiments_nav(_('Terraform modules'))
2022-05-07 20:08:51 +05:30
visit project_path(project)
end
it_behaves_like 'verified navigation bar'
end
2020-03-13 15:44:24 +05:30
end