Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
b8fb1336
Commit
b8fb1336
authored
Jan 29, 2020
by
Adam Hegyi
Committed by
Rémy Coutable
Jan 29, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix missing 'Pipeline schedules' link
- Add test case for FOSS and EE project and group navbar structure.
parent
febaf3f9
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
176 additions
and
1 deletion
+176
-1
app/views/layouts/nav/sidebar/_project.html.haml
app/views/layouts/nav/sidebar/_project.html.haml
+1
-1
spec/features/groups/navbar_spec.rb
spec/features/groups/navbar_spec.rb
+51
-0
spec/features/projects/navbar_spec.rb
spec/features/projects/navbar_spec.rb
+104
-0
spec/support/shared_examples/features/navbar_shared_examples.rb
...upport/shared_examples/features/navbar_shared_examples.rb
+20
-0
No files found.
app/views/layouts/nav/sidebar/_project.html.haml
View file @
b8fb1336
...
...
@@ -209,7 +209,7 @@
%span
=
_
(
'Artifacts'
)
-
if
!
should_display_analytics_pages_in_sidebar
&&
project_nav_tab?
(
:pipelines
)
-
if
project_nav_tab?
(
:pipelines
)
=
nav_link
(
controller: :pipeline_schedules
)
do
=
link_to
pipeline_schedules_path
(
@project
),
title:
_
(
'Schedules'
),
class:
'shortcuts-builds'
do
%span
...
...
spec/features/groups/navbar_spec.rb
0 → 100644
View file @
b8fb1336
# frozen_string_literal: true
require
'spec_helper'
describe
'Group navbar'
do
it_behaves_like
'verified navigation bar'
do
let
(
:user
)
{
create
(
:user
)
}
let
(
:group
)
{
create
(
:group
)
}
let
(
:structure
)
do
[
{
nav_item:
_
(
'Group overview'
),
nav_sub_items:
[
_
(
'Details'
),
_
(
'Activity'
),
(
_
(
'Contribution Analytics'
)
if
Gitlab
.
ee?
)
]
},
{
nav_item:
_
(
'Issues'
),
nav_sub_items:
[
_
(
'List'
),
_
(
'Board'
),
_
(
'Labels'
),
_
(
'Milestones'
)
]
},
{
nav_item:
_
(
'Merge Requests'
),
nav_sub_items:
[]
},
{
nav_item:
_
(
'Kubernetes'
),
nav_sub_items:
[]
},
{
nav_item:
_
(
'Members'
),
nav_sub_items:
[]
}
]
end
before
do
group
.
add_maintainer
(
user
)
sign_in
(
user
)
visit
group_path
(
group
)
end
end
end
spec/features/projects/navbar_spec.rb
0 → 100644
View file @
b8fb1336
# frozen_string_literal: true
require
'spec_helper'
describe
'Project navbar'
do
it_behaves_like
'verified navigation bar'
do
let
(
:user
)
{
create
(
:user
)
}
let
(
:project
)
{
create
(
:project
,
:repository
)
}
let
(
:structure
)
do
[
{
nav_item:
_
(
'Project overview'
),
nav_sub_items:
[
_
(
'Details'
),
_
(
'Activity'
),
_
(
'Releases'
)
]
},
{
nav_item:
_
(
'Repository'
),
nav_sub_items:
[
_
(
'Files'
),
_
(
'Commits'
),
_
(
'Branches'
),
_
(
'Tags'
),
_
(
'Contributors'
),
_
(
'Graph'
),
_
(
'Compare'
),
(
_
(
'Locked Files'
)
if
Gitlab
.
ee?
)
]
},
{
nav_item:
_
(
'Issues'
),
nav_sub_items:
[
_
(
'List'
),
_
(
'Boards'
),
_
(
'Labels'
),
_
(
'Milestones'
)
]
},
{
nav_item:
_
(
'Merge Requests'
),
nav_sub_items:
[]
},
{
nav_item:
_
(
'CI / CD'
),
nav_sub_items:
[
_
(
'Pipelines'
),
_
(
'Jobs'
),
_
(
'Artifacts'
),
_
(
'Schedules'
)
]
},
{
nav_item:
_
(
'Operations'
),
nav_sub_items:
[
_
(
'Metrics'
),
_
(
'Environments'
),
_
(
'Error Tracking'
),
_
(
'Serverless'
),
_
(
'Kubernetes'
),
_
(
'Auto DevOps'
)
]
},
{
nav_item:
_
(
'Analytics'
),
nav_sub_items:
[
(
_
(
'Code Review'
)
if
Gitlab
.
ee?
),
_
(
'Cycle Analytics'
),
_
(
'Repository Analytics'
)
]
},
{
nav_item:
_
(
'Wiki'
),
nav_sub_items:
[]
},
{
nav_item:
_
(
'Snippets'
),
nav_sub_items:
[]
},
{
nav_item:
_
(
'Settings'
),
nav_sub_items:
[
_
(
'General'
),
_
(
'Members'
),
_
(
'Integrations'
),
_
(
'Repository'
),
_
(
'CI / CD'
),
_
(
'Operations'
),
(
_
(
'Audit Events'
)
if
Gitlab
.
ee?
)
].
compact
}
]
end
before
do
project
.
add_maintainer
(
user
)
sign_in
(
user
)
visit
project_path
(
project
)
end
end
end
spec/support/shared_examples/features/navbar_shared_examples.rb
0 → 100644
View file @
b8fb1336
# frozen_string_literal: true
RSpec
.
shared_examples
'verified navigation bar'
do
it
'renders correctly'
do
current_structure
=
page
.
find_all
(
'.sidebar-top-level-items > li'
,
class:
[
'!hidden'
]).
map
do
|
item
|
nav_item
=
item
.
find_all
(
'a'
).
first
.
text
.
gsub
(
/\s+\d+$/
,
''
)
# remove counts at the end
nav_sub_items
=
item
.
find_all
(
'.sidebar-sub-level-items a'
)
.
map
(
&
:text
)
.
drop
(
1
)
# remove the first hidden item
{
nav_item:
nav_item
,
nav_sub_items:
nav_sub_items
}
end
structure
.
each
{
|
s
|
s
[
:nav_sub_items
].
compact!
}
expect
(
current_structure
).
to
eq
(
structure
)
end
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment