blob: 3239578a17318d4176a36e7216b811ec237525ac (
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 { mount } from '@vue/test-utils';
import { GlBadge } from '@gitlab/ui';
import ExperimentBadge from '~/vue_shared/components/badges/experiment_badge.vue';
describe('Experiment badge component', () => {
let wrapper;
const findBadge = () => wrapper.findComponent(GlBadge);
const createWrapper = (props = {}) => {
wrapper = mount(ExperimentBadge, {
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');
});
});
|