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
5711ad70
Commit
5711ad70
authored
Apr 22, 2021
by
Savas Vedova
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implement code review suggestion
parent
2a7944e6
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
14 deletions
+6
-14
ee/spec/frontend/security_dashboard/components/vulnerability_count_list_spec.js
...ity_dashboard/components/vulnerability_count_list_spec.js
+6
-14
No files found.
ee/spec/frontend/security_dashboard/components/vulnerability_count_list_spec.js
View file @
5711ad70
...
@@ -92,28 +92,20 @@ describe('Vulnerabilities count list component', () => {
...
@@ -92,28 +92,20 @@ describe('Vulnerabilities count list component', () => {
});
});
describe
.
each
`
describe
.
each
`
dashboardType |
fullPath
| expectedContainedQueryVariables
dashboardType |
provide
| expectedContainedQueryVariables
${
DASHBOARD_TYPES
.
INSTANCE
}
|
${
undefined
}
|
${{
isInstance
:
true
,
isGroup
:
false
,
isProject
:
false
}
}
${
DASHBOARD_TYPES
.
INSTANCE
}
|
${
undefined
}
|
${{
isInstance
:
true
,
isGroup
:
false
,
isProject
:
false
}
}
${
DASHBOARD_TYPES
.
GROUP
}
|
${
'
group/path
'
}
|
${{
isInstance
:
false
,
isGroup
:
true
,
isProject
:
false
}
}
${
DASHBOARD_TYPES
.
GROUP
}
|
${
{
groupFullPath
:
'
group/path
'
}
}
|
${{
isInstance
:
false
,
isGroup
:
true
,
isProject
:
false
}
}
${
DASHBOARD_TYPES
.
PROJECT
}
|
${
'
project/path
'
}
|
${{
isInstance
:
false
,
isGroup
:
false
,
isProject
:
true
}
}
${
DASHBOARD_TYPES
.
PROJECT
}
|
${
{
projectFullPath
:
'
project/path
'
}
} |
${{
isInstance
:
false
,
isGroup
:
false
,
isProject
:
true
}
}
`
(
`
(
'
when the dashboard type is $dashboardType
'
,
'
when the dashboard type is $dashboardType
'
,
({
dashboardType
,
fullPath
,
expectedContainedQueryVariables
})
=>
{
({
dashboardType
,
provide
,
expectedContainedQueryVariables
})
=>
{
beforeEach
(()
=>
{
beforeEach
(()
=>
{
const
mockResponse
=
jest
const
mockResponse
=
jest
.
fn
()
.
fn
()
.
mockResolvedValue
(
mockVulnerabilitySeveritiesGraphQLResponse
({
dashboardType
}));
.
mockResolvedValue
(
mockVulnerabilitySeveritiesGraphQLResponse
({
dashboardType
}));
const
provide
=
{
dashboardType
,
groupFullPath
:
undefined
,
projectFullPath
:
undefined
};
if
(
expectedContainedQueryVariables
.
isGroup
)
{
provide
.
groupFullPath
=
fullPath
;
}
else
if
(
expectedContainedQueryVariables
.
isProject
)
{
provide
.
projectFullPath
=
fullPath
;
}
createWrapperWithApollo
({
createWrapperWithApollo
({
provide
,
provide
:
{
dashboardType
,
...
provide
}
,
propsData
:
{
filters
:
{
someFilter
:
1
}
},
propsData
:
{
filters
:
{
someFilter
:
1
}
},
query
:
mockResponse
,
query
:
mockResponse
,
stubs
:
{
VulnerabilityCountListLayout
},
stubs
:
{
VulnerabilityCountListLayout
},
...
...
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