summaryrefslogtreecommitdiff
path: root/spec/features/projects/navbar_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/features/projects/navbar_spec.rb')
-rw-r--r--spec/features/projects/navbar_spec.rb160
1 files changed, 28 insertions, 132 deletions
diff --git a/spec/features/projects/navbar_spec.rb b/spec/features/projects/navbar_spec.rb
index bce11e6bc8a..876bc82d16c 100644
--- a/spec/features/projects/navbar_spec.rb
+++ b/spec/features/projects/navbar_spec.rb
@@ -14,134 +14,54 @@ RSpec.describe 'Project navbar' do
before do
sign_in(user)
- end
- context 'when sidebar refactor feature flag is disabled' do
- let(:project_context_nav_item) do
- nil
- end
+ stub_config(registry: { enabled: false })
+ insert_package_nav(_('Infrastructure'))
+ insert_infrastructure_registry_nav
+ end
+ it_behaves_like 'verified navigation bar' do
before do
- stub_feature_flags(sidebar_refactor: false)
- insert_package_nav(_('Operations'))
- insert_infrastructure_registry_nav
-
- insert_after_sub_nav_item(
- _('Boards'),
- within: _('Issues'),
- new_sub_nav_item_name: _('Labels')
- )
-
- insert_after_nav_item(
- _('Snippets'),
- new_nav_item: {
- nav_item: _('Members'),
- nav_sub_items: []
- }
- )
-
- stub_config(registry: { enabled: false })
+ visit project_path(project)
end
+ end
- it_behaves_like 'verified navigation bar' do
- before do
- visit project_path(project)
- end
+ context 'when value stream is available' do
+ before do
+ visit project_path(project)
end
- context 'when value stream is available' do
- before do
- visit project_path(project)
+ it 'redirects to value stream when Analytics item is clicked' do
+ page.within('.sidebar-top-level-items') do
+ find('.shortcuts-analytics').click
end
- it 'redirects to value stream when Analytics item is clicked' do
- page.within('.sidebar-top-level-items') do
- find('.shortcuts-analytics').click
- end
-
- wait_for_requests
+ wait_for_requests
- expect(page).to have_current_path(project_cycle_analytics_path(project))
- end
- end
-
- context 'when pages are available' do
- before do
- stub_config(pages: { enabled: true })
-
- insert_after_sub_nav_item(
- _('Operations'),
- within: _('Settings'),
- new_sub_nav_item_name: _('Pages')
- )
-
- visit project_path(project)
- end
-
- it_behaves_like 'verified navigation bar'
- end
-
- context 'when container registry is available' do
- before do
- stub_config(registry: { enabled: true })
-
- insert_container_nav
-
- visit project_path(project)
- end
-
- it_behaves_like 'verified navigation bar'
+ expect(page).to have_current_path(project_cycle_analytics_path(project))
end
end
- context 'when sidebar refactor feature flag is enabled' do
- let(:monitor_nav_item) do
- {
- nav_item: _('Monitor'),
- nav_sub_items: monitor_menu_items
- }
- end
+ context 'when pages are available' do
+ before do
+ stub_config(pages: { enabled: true })
- let(:monitor_menu_items) do
- [
- _('Metrics'),
- _('Logs'),
- _('Tracing'),
- _('Error Tracking'),
- _('Alerts'),
- _('Incidents'),
- _('Product Analytics')
- ]
- end
+ insert_after_sub_nav_item(
+ _('Monitor'),
+ within: _('Settings'),
+ new_sub_nav_item_name: _('Pages')
+ )
- let(:project_information_nav_item) do
- {
- nav_item: _('Project information'),
- nav_sub_items: [
- _('Activity'),
- _('Labels'),
- _('Members')
- ]
- }
+ visit project_path(project)
end
- let(:settings_menu_items) do
- [
- _('General'),
- _('Integrations'),
- _('Webhooks'),
- _('Access Tokens'),
- _('Repository'),
- _('CI/CD'),
- _('Monitor')
- ]
- end
+ it_behaves_like 'verified navigation bar'
+ end
+ context 'when container registry is available' do
before do
- stub_feature_flags(sidebar_refactor: true)
stub_config(registry: { enabled: true })
- insert_package_nav(_('Monitor'))
- insert_infrastructure_registry_nav
+
insert_container_nav
insert_after_sub_nav_item(
@@ -150,30 +70,6 @@ RSpec.describe 'Project navbar' do
new_sub_nav_item_name: _('Packages & Registries')
)
- insert_after_nav_item(
- _('Monitor'),
- new_nav_item: {
- nav_item: _('Infrastructure'),
- nav_sub_items: [
- _('Kubernetes clusters'),
- _('Serverless platform'),
- _('Terraform')
- ]
- }
- )
-
- insert_after_nav_item(
- _('Security & Compliance'),
- new_nav_item: {
- nav_item: _('Deployments'),
- nav_sub_items: [
- _('Feature Flags'),
- _('Environments'),
- _('Releases')
- ]
- }
- )
-
visit project_path(project)
end