diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-04-10 15:09:50 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-04-10 15:09:50 +0000 |
commit | de2fb5b82c92c90f90ed67ced45143c04e934fb8 (patch) | |
tree | ff8e5e642580de7bb596d90dd0e7f739f44ca540 /spec/frontend/jira_import/components/jira_import_form_spec.js | |
parent | c6a33b298229f9e04933be43d6176c476ef03012 (diff) | |
download | gitlab-ce-de2fb5b82c92c90f90ed67ced45143c04e934fb8.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/frontend/jira_import/components/jira_import_form_spec.js')
-rw-r--r-- | spec/frontend/jira_import/components/jira_import_form_spec.js | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/spec/frontend/jira_import/components/jira_import_form_spec.js b/spec/frontend/jira_import/components/jira_import_form_spec.js new file mode 100644 index 00000000000..315ccccd991 --- /dev/null +++ b/spec/frontend/jira_import/components/jira_import_form_spec.js @@ -0,0 +1,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'); + }); +}); |