Commit 75947d15 authored by Kushal Pandya's avatar Kushal Pandya

Merge branch '230381-use-gl-badge' into 'master'

Use gl-badge instead of custom styles

See merge request gitlab-org/gitlab!43030
parents ae539fe6 003b5930
<script> <script>
import { GlIcon, GlPopover } from '@gitlab/ui'; import { GlIcon, GlPopover, GlBadge } from '@gitlab/ui';
export default { export default {
components: { components: {
GlIcon, GlIcon,
GlPopover, GlPopover,
GlBadge,
}, },
}; };
</script> </script>
<template> <template>
<div class="gl-display-inline-block"> <div class="gl-display-inline-block">
<span class="gl-display-inline-block gl-rounded-lg gl-bg-blue-200 gl-text-blue-500 gl-px-3"> <gl-badge ref="badge" variant="info">
<gl-icon ref="badge" name="admin" /> <gl-icon name="admin" />
</span> </gl-badge>
<gl-popover <gl-popover
ref="popover" ref="popover"
:content=" :content="
......
import { shallowMount } from '@vue/test-utils'; import { shallowMount } from '@vue/test-utils';
import { GlIcon, GlPopover } from '@gitlab/ui'; import { GlIcon, GlPopover, GlBadge } from '@gitlab/ui';
import RemediatedBadge from 'ee/vulnerabilities/components/remediated_badge.vue'; import RemediatedBadge from 'ee/vulnerabilities/components/remediated_badge.vue';
const POPOVER_TITLE = 'Vulnerability remediated. Review before resolving.'; const POPOVER_TITLE = 'Vulnerability remediated. Review before resolving.';
...@@ -10,6 +10,7 @@ describe('Remediated badge component', () => { ...@@ -10,6 +10,7 @@ describe('Remediated badge component', () => {
let wrapper; let wrapper;
const findIcon = () => wrapper.find(GlIcon); const findIcon = () => wrapper.find(GlIcon);
const findBadge = () => wrapper.find(GlBadge);
const createWrapper = () => { const createWrapper = () => {
return shallowMount(RemediatedBadge); return shallowMount(RemediatedBadge);
...@@ -27,7 +28,7 @@ describe('Remediated badge component', () => { ...@@ -27,7 +28,7 @@ describe('Remediated badge component', () => {
it('should link the badge and the popover', () => { it('should link the badge and the popover', () => {
const { popover } = wrapper.vm.$refs; const { popover } = wrapper.vm.$refs;
expect(popover.$attrs.target()).toEqual(findIcon().element); expect(popover.$attrs.target()).toEqual(findBadge().element);
}); });
it('should pass down the data to the popover', () => { it('should pass down the data to 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