Make badge in pipeline-status-badge Pajamas compliant

parent 8b5b39ce
<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>
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);
}); });
}); });
}); });
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment