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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
|
import { GlAvatar, GlNewButton, GlFormSelect, GlLabel } from '@gitlab/ui';
import { shallowMount } from '@vue/test-utils';
import JiraImportForm from '~/jira_import/components/jira_import_form.vue';
describe('JiraImportForm', () => {
let wrapper;
beforeEach(() => {
wrapper = shallowMount(JiraImportForm);
});
afterEach(() => {
wrapper.destroy();
wrapper = null;
});
it('shows a dropdown to choose the Jira project to import from', () => {
expect(wrapper.find(GlFormSelect).exists()).toBe(true);
});
it('shows a label which will be applied to imported Jira projects', () => {
expect(wrapper.find(GlLabel).attributes('title')).toBe('jira-import::KEY-1');
});
it('shows information to the user', () => {
expect(wrapper.find('p').text()).toBe(
"For each Jira issue successfully imported, we'll create a new GitLab issue with the following data:",
);
});
it('shows jira.issue.summary for the Title', () => {
expect(wrapper.find('[id="jira-project-title"]').text()).toBe('jira.issue.summary');
});
it('shows an avatar for the Reporter', () => {
expect(wrapper.find(GlAvatar).exists()).toBe(true);
});
it('shows jira.issue.description.content for the Description', () => {
expect(wrapper.find('[id="jira-project-description"]').text()).toBe(
'jira.issue.description.content',
);
});
it('shows a Next button', () => {
const nextButton = wrapper
.findAll(GlNewButton)
.at(0)
.text();
expect(nextButton).toBe('Next');
});
it('shows a Cancel button', () => {
const cancelButton = wrapper
.findAll(GlNewButton)
.at(1)
.text();
expect(cancelButton).toBe('Cancel');
});
});
|