blob: bcc131d54c2389432e47d21ff0dcdd2fee5610f7 (
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
33
34
35
36
37
38
39
40
41
42
43
44
|
import { shallowMount } from '@vue/test-utils';
import { GlLink } from '@gitlab/ui';
import PinnedLinks from '~/issue_show/components/pinned_links.vue';
const plainZoomUrl = 'https://zoom.us/j/123456789';
describe('PinnedLinks', () => {
let wrapper;
const link = {
get text() {
return wrapper.find(GlLink).text();
},
get href() {
return wrapper.find(GlLink).attributes('href');
},
};
const createComponent = props => {
wrapper = shallowMount(PinnedLinks, {
sync: false,
propsData: {
zoomMeetingUrl: null,
...props,
},
});
};
it('displays Zoom link', () => {
createComponent({
zoomMeetingUrl: `<a href="${plainZoomUrl}">Zoom</a>`,
});
expect(link.text).toBe('Join Zoom meeting');
});
it('does not render if there are no links', () => {
createComponent({
zoomMeetingUrl: null,
});
expect(wrapper.find(GlLink).exists()).toBe(false);
});
});
|