Make remediated-badge Pajamas compliant

Replaces ad hoc icon with GlBadge's icon prop in remediated_badge.vue.
parent aed836d7
<script> <script>
import { GlIcon, GlPopover, GlBadge } from '@gitlab/ui'; import { GlPopover, GlBadge } from '@gitlab/ui';
export default { export default {
components: { components: {
GlIcon,
GlPopover, GlPopover,
GlBadge, GlBadge,
}, },
...@@ -25,9 +24,7 @@ export default { ...@@ -25,9 +24,7 @@ export default {
<template> <template>
<div class="gl-display-inline-block"> <div class="gl-display-inline-block">
<gl-badge ref="badge" variant="info"> <gl-badge ref="badge" variant="info" icon="check-circle-dashed" />
<gl-icon name="check-circle-dashed" />
</gl-badge>
<gl-popover <gl-popover
ref="popover" ref="popover"
:content=" :content="
......
import { GlIcon, GlPopover, GlBadge } from '@gitlab/ui'; import { GlPopover, GlBadge } from '@gitlab/ui';
import { shallowMount } from '@vue/test-utils'; import { shallowMount } from '@vue/test-utils';
import RemediatedBadge from 'ee/vulnerabilities/components/remediated_badge.vue'; import RemediatedBadge from 'ee/vulnerabilities/components/remediated_badge.vue';
...@@ -9,7 +9,6 @@ const POPOVER_CONTENT = ...@@ -9,7 +9,6 @@ const POPOVER_CONTENT =
describe('Remediated badge component', () => { describe('Remediated badge component', () => {
let wrapper; let wrapper;
const findIcon = () => wrapper.find(GlIcon);
const findBadge = () => wrapper.find(GlBadge); const findBadge = () => wrapper.find(GlBadge);
const createWrapper = () => { const createWrapper = () => {
...@@ -23,7 +22,7 @@ describe('Remediated badge component', () => { ...@@ -23,7 +22,7 @@ describe('Remediated badge component', () => {
afterEach(() => wrapper.destroy()); afterEach(() => wrapper.destroy());
it('should display the correct icon', () => { it('should display the correct icon', () => {
expect(findIcon().props('name')).toBe('check-circle-dashed'); expect(findBadge().props('icon')).toBe('check-circle-dashed');
}); });
it('should link the badge and the popover', () => { it('should link the badge and the popover', () => {
......
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