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
5b743816
Commit
5b743816
authored
Jan 18, 2022
by
Paul Gascou-Vaillancourt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make badge in pipeline-status-badge Pajamas compliant
parent
8b5b39ce
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
8 deletions
+4
-8
ee/app/assets/javascripts/security_dashboard/components/shared/pipeline_status_badge.vue
...ity_dashboard/components/shared/pipeline_status_badge.vue
+3
-4
ee/spec/frontend/security_dashboard/components/shared/pipeline_status_badge_spec.js
...dashboard/components/shared/pipeline_status_badge_spec.js
+1
-4
No files found.
ee/app/assets/javascripts/security_dashboard/components/shared/pipeline_status_badge.vue
View file @
5b743816
<
script
>
<
script
>
import
{
GlBadge
,
GlIcon
}
from
'
@gitlab/ui
'
;
import
{
GlBadge
}
from
'
@gitlab/ui
'
;
export
default
{
export
default
{
components
:
{
GlBadge
,
GlIcon
},
components
:
{
GlBadge
},
props
:
{
props
:
{
pipeline
:
{
pipeline
:
{
type
:
Object
,
type
:
Object
,
...
@@ -24,8 +24,7 @@ export default {
...
@@ -24,8 +24,7 @@ export default {
</
script
>
</
script
>
<
template
>
<
template
>
<gl-badge
v-if=
"shouldShow"
variant=
"danger"
:href=
"failedPath"
>
<gl-badge
v-if=
"shouldShow"
icon=
"status_failed"
variant=
"danger"
:href=
"failedPath"
>
<gl-icon
name=
"status_failed"
class=
"gl-mr-2"
/>
{{
n__
(
'
%d failed security job
'
,
'
%d failed security jobs
'
,
failedCount
)
}}
{{
n__
(
'
%d failed security job
'
,
'
%d failed security jobs
'
,
failedCount
)
}}
</gl-badge>
</gl-badge>
</
template
>
</
template
>
ee/spec/frontend/security_dashboard/components/shared/pipeline_status_badge_spec.js
View file @
5b743816
import
{
GlBadge
,
GlIcon
}
from
'
@gitlab/ui
'
;
import
{
GlBadge
}
from
'
@gitlab/ui
'
;
import
{
shallowMount
}
from
'
@vue/test-utils
'
;
import
{
shallowMount
}
from
'
@vue/test-utils
'
;
import
{
merge
}
from
'
lodash
'
;
import
{
merge
}
from
'
lodash
'
;
import
PipelineStatusBadge
from
'
ee/security_dashboard/components/shared/pipeline_status_badge.vue
'
;
import
PipelineStatusBadge
from
'
ee/security_dashboard/components/shared/pipeline_status_badge.vue
'
;
...
@@ -9,7 +9,6 @@ describe('Pipeline status badge', () => {
...
@@ -9,7 +9,6 @@ describe('Pipeline status badge', () => {
const
securityBuildsFailedPath
=
'
/some/path/to/failed/jobs
'
;
const
securityBuildsFailedPath
=
'
/some/path/to/failed/jobs
'
;
const
findGlBadge
=
()
=>
wrapper
.
find
(
GlBadge
);
const
findGlBadge
=
()
=>
wrapper
.
find
(
GlBadge
);
const
findGlIcon
=
()
=>
wrapper
.
find
(
GlIcon
);
const
createProps
=
(
securityBuildsFailedCount
)
=>
({
pipeline
:
{
securityBuildsFailedCount
}
});
const
createProps
=
(
securityBuildsFailedCount
)
=>
({
pipeline
:
{
securityBuildsFailedCount
}
});
...
@@ -46,13 +45,11 @@ describe('Pipeline status badge', () => {
...
@@ -46,13 +45,11 @@ describe('Pipeline status badge', () => {
it
(
'
does not display when there are 0 failed jobs
'
,
()
=>
{
it
(
'
does not display when there are 0 failed jobs
'
,
()
=>
{
createWrapper
(
createProps
(
0
));
createWrapper
(
createProps
(
0
));
expect
(
findGlBadge
().
exists
()).
toBe
(
false
);
expect
(
findGlBadge
().
exists
()).
toBe
(
false
);
expect
(
findGlIcon
().
exists
()).
toBe
(
false
);
});
});
it
(
'
does not display when there is no failed jobs count
'
,
()
=>
{
it
(
'
does not display when there is no failed jobs count
'
,
()
=>
{
createWrapper
();
createWrapper
();
expect
(
findGlBadge
().
exists
()).
toBe
(
false
);
expect
(
findGlBadge
().
exists
()).
toBe
(
false
);
expect
(
findGlIcon
().
exists
()).
toBe
(
false
);
});
});
});
});
});
});
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