blob: c96a570a29c562d5c6c1e9dd13d5befa1c15971f (
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 { GlIcon } from '@gitlab/ui';
import { shallowMount } from '@vue/test-utils';
import PackageIconAndName from '~/packages/shared/components/package_icon_and_name.vue';
describe('PackageIconAndName', () => {
let wrapper;
const findIcon = () => wrapper.find(GlIcon);
const mountComponent = () => {
wrapper = shallowMount(PackageIconAndName, {
slots: {
default: 'test',
},
});
};
it('has an icon', () => {
mountComponent();
const icon = findIcon();
expect(icon.exists()).toBe(true);
expect(icon.props('name')).toBe('package');
});
it('renders the slot content', () => {
mountComponent();
expect(wrapper.text()).toBe('test');
});
});
|