blob: c930c6d570849f5576ad61a7654c989388aa9798 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
import { shallowMount } from '@vue/test-utils';
import { GlBadge } from '@gitlab/ui';
import BetaBadge from '~/vue_shared/components/badges/beta_badge.vue';
describe('Beta badge component', () => {
let wrapper;
const findBadge = () => wrapper.findComponent(GlBadge);
const createWrapper = (props = {}) => {
wrapper = shallowMount(BetaBadge, {
propsData: { ...props },
});
};
it('renders the badge', () => {
createWrapper();
expect(wrapper.element).toMatchSnapshot();
});
it('passes default size to badge', () => {
createWrapper();
expect(findBadge().props('size')).toBe('md');
});
it('passes given size to badge', () => {
createWrapper({ size: 'sm' });
expect(findBadge().props('size')).toBe('sm');
});
});
|