Commit f6ddd1b3 authored by Heinrich Lee Yu's avatar Heinrich Lee Yu

Merge branch 'incubation_5mp_google_cloud_backend_menu_fixups' into 'master'

Improve `Project :: Infra :: Google Cloud` Menu

See merge request gitlab-org/gitlab!73889
parents d0dfcc7c 42041bdb
...@@ -100,7 +100,7 @@ module Sidebars ...@@ -100,7 +100,7 @@ module Sidebars
::Sidebars::MenuItem.new( ::Sidebars::MenuItem.new(
title: _('Google Cloud'), title: _('Google Cloud'),
link: project_google_cloud_index_path(context.project), link: project_google_cloud_index_path(context.project),
active_routes: {}, active_routes: { controller: :google_cloud },
item_id: :google_cloud item_id: :google_cloud
) )
end end
......
...@@ -51,6 +51,16 @@ RSpec.describe Sidebars::Projects::Menus::InfrastructureMenu do ...@@ -51,6 +51,16 @@ RSpec.describe Sidebars::Projects::Menus::InfrastructureMenu do
it 'menu link points to Terraform page' do it 'menu link points to Terraform page' do
expect(subject.link).to eq find_menu_item(:terraform).link expect(subject.link).to eq find_menu_item(:terraform).link
end end
context 'when Terraform menu is not visible' do
before do
subject.renderable_items.delete(find_menu_item(:terraform))
end
it 'menu link points to Google Cloud page' do
expect(subject.link).to eq find_menu_item(:google_cloud).link
end
end
end end
end end
...@@ -89,5 +99,11 @@ RSpec.describe Sidebars::Projects::Menus::InfrastructureMenu do ...@@ -89,5 +99,11 @@ RSpec.describe Sidebars::Projects::Menus::InfrastructureMenu do
it_behaves_like 'access rights checks' it_behaves_like 'access rights checks'
end end
describe 'Google Cloud' do
let(:item_id) { :google_cloud }
it_behaves_like 'access rights checks'
end
end end
end end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment