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

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

112 lines
2.5 KiB
Ruby
Raw Normal View History

2020-03-13 15:44:24 +05:30
# frozen_string_literal: true
require 'spec_helper'
2020-06-23 00:09:42 +05:30
RSpec.describe 'Group navbar' do
2020-04-22 19:07:51 +05:30
include NavbarStructureHelper
2020-11-24 15:15:51 +05:30
include WikiHelpers
2020-03-13 15:44:24 +05:30
2020-04-22 19:07:51 +05:30
include_context 'group navbar structure'
let_it_be(:user) { create(:user) }
2022-03-02 08:16:31 +05:30
let(:group) { create(:group) }
2020-03-13 15:44:24 +05:30
2020-04-22 19:07:51 +05:30
before do
2020-10-24 23:57:45 +05:30
insert_package_nav(_('Kubernetes'))
2022-10-11 01:57:18 +05:30
insert_after_nav_item(_('Analytics'), new_nav_item: settings_for_maintainer_nav_item) if Gitlab.ee?
2020-10-24 23:57:45 +05:30
2021-01-29 00:20:46 +05:30
stub_config(dependency_proxy: { enabled: false })
stub_config(registry: { enabled: false })
2022-05-07 20:08:51 +05:30
stub_feature_flags(harbor_registry_integration: false)
2022-10-11 01:57:18 +05:30
stub_feature_flags(observability_group_tab: false)
2020-11-24 15:15:51 +05:30
stub_group_wikis(false)
2020-04-22 19:07:51 +05:30
group.add_maintainer(user)
sign_in(user)
2020-03-13 15:44:24 +05:30
end
it_behaves_like 'verified navigation bar' do
before do
visit group_path(group)
end
end
2020-05-24 23:13:21 +05:30
context 'when container registry is available' do
before do
stub_config(registry: { enabled: true })
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 group_path(group)
end
it_behaves_like 'verified navigation bar'
end
2021-01-03 14:25:43 +05:30
2022-07-23 23:45:48 +05:30
context 'when customer_relations feature is enabled' do
2022-03-02 08:16:31 +05:30
let(:group) { create(:group, :crm_enabled) }
2021-12-11 22:18:48 +05:30
before do
if Gitlab.ee?
insert_customer_relations_nav(_('Analytics'))
else
2022-10-11 01:57:18 +05:30
insert_customer_relations_nav(_('Packages and registries'))
2021-12-11 22:18:48 +05:30
end
visit group_path(group)
end
it_behaves_like 'verified navigation bar'
end
2022-07-23 23:45:48 +05:30
context 'when customer_relations feature is enabled but subgroup' do
2022-05-07 20:08:51 +05:30
let(:group) { create(:group, :crm_enabled, parent: create(:group)) }
before do
visit group_path(group)
end
it_behaves_like 'verified navigation bar'
end
2021-01-29 00:20:46 +05:30
context 'when dependency proxy is available' do
before do
stub_config(dependency_proxy: { enabled: true })
2021-04-29 21:17:54 +05:30
insert_dependency_proxy_nav
2021-01-29 00:20:46 +05:30
visit group_path(group)
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(:harbor_integration) { create(:harbor_integration, group: group, project: nil) }
2022-05-07 20:08:51 +05:30
before do
2022-10-11 01:57:18 +05:30
group.update!(harbor_integration: harbor_integration)
2022-05-07 20:08:51 +05:30
stub_feature_flags(harbor_registry_integration: true)
insert_harbor_registry_nav(_('Package Registry'))
visit group_path(group)
end
it_behaves_like 'verified navigation bar'
end
2022-10-11 01:57:18 +05:30
context 'when observability tab is enabled' do
before do
stub_feature_flags(observability_group_tab: true)
insert_observability_nav
visit group_path(group)
end
it_behaves_like 'verified navigation bar'
end
2020-03-13 15:44:24 +05:30
end