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
a767966d
Commit
a767966d
authored
Apr 10, 2020
by
Savas Vedova
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add the Project Security Status table
- Add related tests
parent
602431a6
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
3 deletions
+25
-3
ee/app/assets/javascripts/security_dashboard/components/first_class_instance_security_dashboard.vue
...rd/components/first_class_instance_security_dashboard.vue
+9
-0
ee/app/assets/javascripts/security_dashboard/first_class_init.js
...assets/javascripts/security_dashboard/first_class_init.js
+1
-0
ee/spec/frontend/security_dashboard/components/first_class_instance_security_dashboard_spec.js
...omponents/first_class_instance_security_dashboard_spec.js
+15
-3
No files found.
ee/app/assets/javascripts/security_dashboard/components/first_class_instance_security_dashboard.vue
View file @
a767966d
<
script
>
import
SecurityDashboardLayout
from
'
ee/security_dashboard/components/security_dashboard_layout.vue
'
;
import
InstanceSecurityVulnerabilities
from
'
./first_class_instance_security_dashboard_vulnerabilities.vue
'
;
import
VulnerabilitySeverity
from
'
ee/security_dashboard/components/vulnerability_severity.vue
'
;
export
default
{
components
:
{
SecurityDashboardLayout
,
InstanceSecurityVulnerabilities
,
VulnerabilitySeverity
,
},
props
:
{
dashboardDocumentation
:
{
...
...
@@ -16,6 +18,10 @@ export default {
type
:
String
,
required
:
true
,
},
vulnerableProjectsEndpoint
:
{
type
:
String
,
required
:
true
,
},
},
};
</
script
>
...
...
@@ -26,5 +32,8 @@ export default {
:dashboard-documentation=
"dashboardDocumentation"
:empty-state-svg-path=
"emptyStateSvgPath"
/>
<template
#aside
>
<vulnerability-severity
:endpoint=
"vulnerableProjectsEndpoint"
/>
</
template
>
</security-dashboard-layout>
</template>
ee/app/assets/javascripts/security_dashboard/first_class_init.js
View file @
a767966d
...
...
@@ -49,6 +49,7 @@ export default (
props
.
vulnerableProjectsEndpoint
=
el
.
dataset
.
vulnerableProjectsEndpoint
;
}
else
if
(
dashboardType
===
DASHBOARD_TYPES
.
INSTANCE
)
{
component
=
FirstClassInstanceSecurityDashboard
;
props
.
vulnerableProjectsEndpoint
=
el
.
dataset
.
vulnerableProjectsEndpoint
;
}
const
router
=
createRouter
();
...
...
ee/spec/frontend/security_dashboard/components/first_class_instance_security_dashboard_spec.js
View file @
a767966d
import
{
shallowMount
}
from
'
@vue/test-utils
'
;
import
SecurityDashboardLayout
from
'
ee/security_dashboard/components/security_dashboard_layout.vue
'
;
import
FirstClassInstanceDashboard
from
'
ee/security_dashboard/components/first_class_instance_security_dashboard.vue
'
;
import
FirstClassInstanceVulnerabilities
from
'
ee/security_dashboard/components/first_class_instance_security_dashboard_vulnerabilities.vue
'
;
import
VulnerabilitySeverity
from
'
ee/security_dashboard/components/vulnerability_severity.vue
'
;
describe
(
'
First Class
Group
Dashboard Component
'
,
()
=>
{
describe
(
'
First Class
Instance
Dashboard Component
'
,
()
=>
{
let
wrapper
;
const
dashboardDocumentation
=
'
dashboard-documentation
'
;
const
emptyStateSvgPath
=
'
empty-state-path
'
;
const
vulnerableProjectsEndpoint
=
'
/vulnerable/projects
'
;
const
findGroupVulnerabilities
=
()
=>
wrapper
.
find
(
FirstClassInstanceVulnerabilities
);
const
findInstanceVulnerabilities
=
()
=>
wrapper
.
find
(
FirstClassInstanceVulnerabilities
);
const
findVulnerabilitySeverity
=
()
=>
wrapper
.
find
(
VulnerabilitySeverity
);
const
createWrapper
=
()
=>
{
return
shallowMount
(
FirstClassInstanceDashboard
,
{
propsData
:
{
dashboardDocumentation
,
emptyStateSvgPath
,
vulnerableProjectsEndpoint
,
},
stubs
:
{
SecurityDashboardLayout
,
},
});
};
...
...
@@ -28,9 +36,13 @@ describe('First Class Group Dashboard Component', () => {
});
it
(
'
should render correctly
'
,
()
=>
{
expect
(
find
Group
Vulnerabilities
().
props
()).
toEqual
({
expect
(
find
Instance
Vulnerabilities
().
props
()).
toEqual
({
dashboardDocumentation
,
emptyStateSvgPath
,
});
});
it
(
'
displays the vulnerability severity in an aside
'
,
()
=>
{
expect
(
findVulnerabilitySeverity
().
exists
()).
toBe
(
true
);
});
});
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