2020-01-29 10:08:59 -05:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
require 'spec_helper'
|
|
|
|
|
2020-06-16 14:09:01 -04:00
|
|
|
RSpec.describe 'Group navbar' do
|
2020-03-19 11:09:41 -04:00
|
|
|
include NavbarStructureHelper
|
2020-09-11 14:08:42 -04:00
|
|
|
include WikiHelpers
|
2020-02-06 07:10:29 -05:00
|
|
|
|
2020-03-19 11:09:41 -04:00
|
|
|
include_context 'group navbar structure'
|
|
|
|
|
|
|
|
let_it_be(:user) { create(:user) }
|
2022-01-07 19:14:32 -05:00
|
|
|
|
|
|
|
let(:group) { create(:group) }
|
2020-01-29 10:08:59 -05:00
|
|
|
|
2020-03-19 11:09:41 -04:00
|
|
|
before do
|
2020-07-21 08:09:30 -04:00
|
|
|
insert_package_nav(_('Kubernetes'))
|
|
|
|
|
2021-10-29 20:10:32 -04:00
|
|
|
stub_feature_flags(customer_relations: false)
|
2020-11-13 16:09:31 -05:00
|
|
|
stub_config(dependency_proxy: { enabled: false })
|
|
|
|
stub_config(registry: { enabled: false })
|
2022-03-10 16:08:21 -05:00
|
|
|
stub_feature_flags(harbor_registry_integration: false)
|
2020-09-11 14:08:42 -04:00
|
|
|
stub_group_wikis(false)
|
2020-03-19 11:09:41 -04:00
|
|
|
group.add_maintainer(user)
|
|
|
|
sign_in(user)
|
2020-02-06 07:10:29 -05:00
|
|
|
end
|
2020-01-29 10:08:59 -05:00
|
|
|
|
2020-02-06 07:10:29 -05:00
|
|
|
it_behaves_like 'verified navigation bar' do
|
2020-01-29 10:08:59 -05:00
|
|
|
before do
|
|
|
|
visit group_path(group)
|
|
|
|
end
|
|
|
|
end
|
2020-05-11 08:10:28 -04:00
|
|
|
|
|
|
|
context 'when container registry is available' do
|
|
|
|
before do
|
|
|
|
stub_config(registry: { enabled: true })
|
|
|
|
|
2021-04-01 08:08:56 -04:00
|
|
|
insert_container_nav
|
2020-07-21 08:09:30 -04:00
|
|
|
|
2020-05-11 08:10:28 -04:00
|
|
|
visit group_path(group)
|
|
|
|
end
|
|
|
|
|
|
|
|
it_behaves_like 'verified navigation bar'
|
|
|
|
end
|
2020-09-28 11:09:44 -04:00
|
|
|
|
2022-01-07 19:14:32 -05:00
|
|
|
context 'when customer_relations feature and flag is enabled' do
|
|
|
|
let(:group) { create(:group, :crm_enabled) }
|
|
|
|
|
2021-10-29 20:10:32 -04:00
|
|
|
before do
|
|
|
|
stub_feature_flags(customer_relations: true)
|
|
|
|
|
|
|
|
if Gitlab.ee?
|
|
|
|
insert_customer_relations_nav(_('Analytics'))
|
|
|
|
else
|
|
|
|
insert_customer_relations_nav(_('Packages & Registries'))
|
|
|
|
end
|
|
|
|
|
|
|
|
visit group_path(group)
|
|
|
|
end
|
|
|
|
|
|
|
|
it_behaves_like 'verified navigation bar'
|
|
|
|
end
|
|
|
|
|
2022-03-14 08:07:59 -04:00
|
|
|
context 'when customer_relations feature and flag is enabled but subgroup' do
|
|
|
|
let(:group) { create(:group, :crm_enabled, parent: create(:group)) }
|
|
|
|
|
|
|
|
before do
|
|
|
|
stub_feature_flags(customer_relations: true)
|
|
|
|
|
|
|
|
visit group_path(group)
|
|
|
|
end
|
|
|
|
|
|
|
|
it_behaves_like 'verified navigation bar'
|
|
|
|
end
|
|
|
|
|
2020-11-13 16:09:31 -05:00
|
|
|
context 'when dependency proxy is available' do
|
|
|
|
before do
|
|
|
|
stub_config(dependency_proxy: { enabled: true })
|
|
|
|
|
2021-04-01 08:08:56 -04:00
|
|
|
insert_dependency_proxy_nav
|
2020-11-13 16:09:31 -05:00
|
|
|
|
|
|
|
visit group_path(group)
|
|
|
|
end
|
|
|
|
|
|
|
|
it_behaves_like 'verified navigation bar'
|
|
|
|
end
|
2022-03-10 16:08:21 -05:00
|
|
|
|
|
|
|
context 'when harbor registry is available' do
|
|
|
|
before do
|
|
|
|
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
|
2020-01-29 10:08:59 -05:00
|
|
|
end
|