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
bbd0ef54
Commit
bbd0ef54
authored
May 17, 2021
by
Savas Vedova
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Apply code review suggestions
parent
8f4f2ff0
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
21 deletions
+19
-21
ee/app/assets/javascripts/security_dashboard/components/pipeline_findings.vue
...ripts/security_dashboard/components/pipeline_findings.vue
+7
-2
ee/spec/frontend/security_dashboard/components/pipeline_findings_spec.js
...d/security_dashboard/components/pipeline_findings_spec.js
+12
-19
No files found.
ee/app/assets/javascripts/security_dashboard/components/pipeline_findings.vue
View file @
bbd0ef54
...
...
@@ -111,7 +111,12 @@ export default {
<
template
>
<div>
<gl-alert
v-if=
"errorLoadingFindings"
class=
"mb-4"
variant=
"danger"
@
dismiss=
"onErrorDismiss"
>
<gl-alert
v-if=
"errorLoadingFindings"
class=
"gl-mb-6"
variant=
"danger"
@
dismiss=
"onErrorDismiss"
>
{{
s__
(
'
SecurityReports|Error fetching the vulnerability list. Please check your network connection and try again.
'
,
...
...
@@ -127,7 +132,7 @@ export default {
/>
<gl-intersection-observer
v-if=
"pageInfo.hasNextPage"
class=
"text-center"
class=
"
gl-
text-center"
@
appear=
"fetchNextPage"
>
<gl-loading-icon
v-if=
"isLoadingQuery"
size=
"md"
/>
...
...
ee/spec/frontend/security_dashboard/components/pipeline_findings_spec.js
View file @
bbd0ef54
...
...
@@ -39,6 +39,12 @@ describe('Pipeline findings', () => {
});
};
const
createWrapperWithApollo
=
(
resolver
)
=>
{
return
createWrapper
({
apolloProvider
:
createMockApollo
([[
pipelineFindingsQuery
,
resolver
]]),
});
};
const
findIntersectionObserver
=
()
=>
wrapper
.
find
(
GlIntersectionObserver
);
const
findAlert
=
()
=>
wrapper
.
find
(
GlAlert
);
const
findVulnerabilityList
=
()
=>
wrapper
.
find
(
VulnerabilityList
);
...
...
@@ -61,14 +67,10 @@ describe('Pipeline findings', () => {
describe
(
'
with findings
'
,
()
=>
{
beforeEach
(()
=>
{
createWrapper
({
apolloProvider
:
createMockApollo
([
[
pipelineFindingsQuery
,
jest
.
fn
().
mockResolvedValue
(
mockPipelineFindingsResponse
())],
]),
});
createWrapperWithApollo
(
jest
.
fn
().
mockResolvedValue
(
mockPipelineFindingsResponse
()));
});
it
(
'
does not show the loading state
'
,
()
=>
{
it
(
'
passes false as the loading state prop
'
,
()
=>
{
expect
(
findVulnerabilityList
().
props
(
'
isLoading
'
)).
toBe
(
false
);
});
...
...
@@ -86,14 +88,9 @@ describe('Pipeline findings', () => {
describe
(
'
with multiple page findings
'
,
()
=>
{
beforeEach
(()
=>
{
createWrapper
({
apolloProvider
:
createMockApollo
([
[
pipelineFindingsQuery
,
createWrapperWithApollo
(
jest
.
fn
().
mockResolvedValue
(
mockPipelineFindingsResponse
({
hasNextPage
:
true
})),
],
]),
});
);
});
it
(
'
shows the insersection loader
'
,
()
=>
{
...
...
@@ -103,11 +100,7 @@ describe('Pipeline findings', () => {
describe
(
'
with failed query
'
,
()
=>
{
beforeEach
(()
=>
{
createWrapper
({
apolloProvider
:
createMockApollo
([
[
pipelineFindingsQuery
,
jest
.
fn
().
mockRejectedValue
(
new
Error
(
'
GrahpQL error
'
))],
]),
});
createWrapperWithApollo
(
jest
.
fn
().
mockRejectedValue
(
new
Error
(
'
GrahpQL error
'
)));
});
it
(
'
does not show the vulnerability list
'
,
()
=>
{
...
...
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