Commit 7482beb8 authored by Mayra Cabrera's avatar Mayra Cabrera

Merge branch '333712-fj-fix-ci_cd_pipelines_menu_item_ative_routes' into 'master'

Fix sidebar CI/CD > Pipelines menu item active routes

See merge request gitlab-org/gitlab!64119
parents c360415b 86573c3f
...@@ -18,6 +18,15 @@ module EE ...@@ -18,6 +18,15 @@ module EE
private private
override :pipelines_routes
def pipelines_routes
super + %w[
pipelines#security
pipelines#licenses
pipelines#codequality_report
]
end
def test_cases_menu_item def test_cases_menu_item
if !context.project.licensed_feature_available?(:quality_management) || if !context.project.licensed_feature_available?(:quality_management) ||
!can?(context.current_user, :read_issue, context.project) !can?(context.current_user, :read_issue, context.project)
......
...@@ -3,17 +3,11 @@ ...@@ -3,17 +3,11 @@
require 'spec_helper' require 'spec_helper'
RSpec.describe 'Project active tab' do RSpec.describe 'Project active tab' do
let(:user) { create :user } let_it_be(:project) { create(:project, :repository) }
let(:project) { create(:project, :repository) }
def click_tab(title) let(:user) { project.owner }
page.within '.sidebar-top-level-items > .active' do
click_link(title)
end
end
before do before do
project.add_maintainer(user)
sign_in(user) sign_in(user)
end end
...@@ -38,4 +32,37 @@ RSpec.describe 'Project active tab' do ...@@ -38,4 +32,37 @@ RSpec.describe 'Project active tab' do
it_behaves_like 'page has active tab', _('Analytics') it_behaves_like 'page has active tab', _('Analytics')
it_behaves_like 'page has active sub tab', _('Code Review') it_behaves_like 'page has active sub tab', _('Code Review')
end end
context 'on project CI/CD' do
context 'browsing Pipelines tabs' do
let_it_be(:pipeline) { create(:ci_pipeline, project: project) }
context 'Security tab' do
before do
visit security_project_pipeline_path(project, pipeline)
end
it_behaves_like 'page has active tab', _('CI/CD')
it_behaves_like 'page has active sub tab', _('Pipelines')
end
context 'Licenses tab' do
before do
visit licenses_project_pipeline_path(project, pipeline)
end
it_behaves_like 'page has active tab', _('CI/CD')
it_behaves_like 'page has active sub tab', _('Pipelines')
end
context 'Code Quality tab' do
before do
visit codequality_report_project_pipeline_path(project, pipeline)
end
it_behaves_like 'page has active tab', _('CI/CD')
it_behaves_like 'page has active sub tab', _('Pipelines')
end
end
end
end end
...@@ -61,6 +61,10 @@ module Sidebars ...@@ -61,6 +61,10 @@ module Sidebars
pipelines#index pipelines#index
pipelines#show pipelines#show
pipelines#new pipelines#new
pipelines#dag
pipelines#failures
pipelines#builds
pipelines#test_report
] ]
end end
......
...@@ -182,4 +182,55 @@ RSpec.describe 'Project active tab' do ...@@ -182,4 +182,55 @@ RSpec.describe 'Project active tab' do
it_behaves_like 'page has active sub tab', _('CI/CD') it_behaves_like 'page has active sub tab', _('CI/CD')
end end
end end
context 'on project CI/CD' do
context 'browsing Pipelines tabs' do
let_it_be(:pipeline) { create(:ci_pipeline, project: project) }
context 'Pipeline tab' do
before do
visit project_pipeline_path(project, pipeline)
end
it_behaves_like 'page has active tab', _('CI/CD')
it_behaves_like 'page has active sub tab', _('Pipelines')
end
context 'Needs tab' do
before do
visit dag_project_pipeline_path(project, pipeline)
end
it_behaves_like 'page has active tab', _('CI/CD')
it_behaves_like 'page has active sub tab', _('Pipelines')
end
context 'Builds tab' do
before do
visit builds_project_pipeline_path(project, pipeline)
end
it_behaves_like 'page has active tab', _('CI/CD')
it_behaves_like 'page has active sub tab', _('Pipelines')
end
context 'Failures tab' do
before do
visit failures_project_pipeline_path(project, pipeline)
end
it_behaves_like 'page has active tab', _('CI/CD')
it_behaves_like 'page has active sub tab', _('Pipelines')
end
context 'Test Report tab' do
before do
visit test_report_project_pipeline_path(project, pipeline)
end
it_behaves_like 'page has active tab', _('CI/CD')
it_behaves_like 'page has active sub tab', _('Pipelines')
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