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
d8fa67ba
Commit
d8fa67ba
authored
Jun 11, 2021
by
Dave Pisek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Reviewer feedback: Minor changes
parent
3a367350
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
7 deletions
+6
-7
ee/app/assets/javascripts/vulnerabilities/components/generic_report/types/commit.vue
...ulnerabilities/components/generic_report/types/commit.vue
+2
-1
ee/spec/frontend/vulnerabilities/generic_report/types/commit_spec.js
...ntend/vulnerabilities/generic_report/types/commit_spec.js
+4
-6
No files found.
ee/app/assets/javascripts/vulnerabilities/components/generic_report/types/commit.vue
View file @
d8fa67ba
...
...
@@ -16,7 +16,8 @@ export default {
computed
:
{
commitPath
()
{
const
{
projectFullPath
,
value
}
=
this
;
// this ensures an absolute path, as `projectFullPath` can be relative in some cases (e.g.: pipeline security tab)
// `projectFullPath` comes in two flavors: relative (e.g.: `group/project`) and absolute (e.g.: `/group/project`)
// adding a leading slash to the relative path makes sure we always link to an absolute path
const
absoluteProjectPath
=
isRootRelative
(
projectFullPath
)
?
projectFullPath
:
`/
${
projectFullPath
}
`
;
...
...
ee/spec/frontend/vulnerabilities/generic_report/types/commit_spec.js
View file @
d8fa67ba
import
{
GlLink
}
from
'
@gitlab/ui
'
;
import
{
shallowMount
}
from
'
@vue/test-utils
'
;
import
Url
from
'
ee/vulnerabilities/components/generic_report/types/commit.vue
'
;
import
Commit
from
'
ee/vulnerabilities/components/generic_report/types/commit.vue
'
;
const
TEST_DATA
=
{
value
:
'
24922148
'
,
...
...
@@ -10,10 +10,8 @@ describe('ee/vulnerabilities/components/generic_report/types/commit.vue', () =>
let
wrapper
;
const
createWrapper
=
({
provide
}
=
{})
=>
{
return
shallowMount
(
Url
,
{
propsData
:
{
...
TEST_DATA
,
},
return
shallowMount
(
Commit
,
{
propsData
:
TEST_DATA
,
provide
:
{
projectFullPath
:
''
,
...
provide
,
...
...
@@ -28,7 +26,7 @@ describe('ee/vulnerabilities/components/generic_report/types/commit.vue', () =>
});
it
.
each
([
'
/foo/bar
'
,
'
foo/bar
'
])(
'
given `projectFullPath` is "%s" it links
links
to the absolute path of the commit
'
,
'
given `projectFullPath` is "%s" it links to the absolute path of the commit
'
,
(
projectFullPath
)
=>
{
const
absoluteCommitPath
=
`/foo/bar/-/commit/
${
TEST_DATA
.
value
}
`
;
...
...
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