diff options
Diffstat (limited to 'spec/frontend/jira_import')
-rw-r--r-- | spec/frontend/jira_import/components/jira_import_app_spec.js | 38 | ||||
-rw-r--r-- | spec/frontend/jira_import/components/jira_import_setup_spec.js | 28 |
2 files changed, 66 insertions, 0 deletions
diff --git a/spec/frontend/jira_import/components/jira_import_app_spec.js b/spec/frontend/jira_import/components/jira_import_app_spec.js new file mode 100644 index 00000000000..fb3ffe1ede3 --- /dev/null +++ b/spec/frontend/jira_import/components/jira_import_app_spec.js @@ -0,0 +1,38 @@ +import { shallowMount } from '@vue/test-utils'; +import JiraImportApp from '~/jira_import/components/jira_import_app.vue'; +import JiraImportSetup from '~/jira_import/components/jira_import_setup.vue'; + +describe('JiraImportApp', () => { + let wrapper; + + afterEach(() => { + wrapper.destroy(); + wrapper = null; + }); + + describe('set up Jira integration page', () => { + beforeEach(() => { + wrapper = shallowMount(JiraImportApp, { + propsData: { + isJiraConfigured: true, + projectPath: 'gitlab-org/gitlab-test', + setupIllustration: 'illustration.svg', + }, + }); + }); + + it('is shown when Jira integration is not configured', () => { + wrapper.setProps({ + isJiraConfigured: false, + }); + + return wrapper.vm.$nextTick(() => { + expect(wrapper.find(JiraImportSetup).exists()).toBe(true); + }); + }); + + it('is not shown when Jira integration is configured', () => { + expect(wrapper.find(JiraImportSetup).exists()).toBe(false); + }); + }); +}); diff --git a/spec/frontend/jira_import/components/jira_import_setup_spec.js b/spec/frontend/jira_import/components/jira_import_setup_spec.js new file mode 100644 index 00000000000..27366bd7e8a --- /dev/null +++ b/spec/frontend/jira_import/components/jira_import_setup_spec.js @@ -0,0 +1,28 @@ +import { shallowMount } from '@vue/test-utils'; +import JiraImportSetup from '~/jira_import/components/jira_import_setup.vue'; + +describe('JiraImportSetup', () => { + let wrapper; + + beforeEach(() => { + wrapper = shallowMount(JiraImportSetup, { + propsData: { + illustration: 'illustration.svg', + }, + }); + }); + + afterEach(() => { + wrapper.destroy(); + wrapper = null; + }); + + it('displays a message to the user', () => { + const message = 'You will first need to set up Jira Integration to use this feature.'; + expect(wrapper.find('p').text()).toBe(message); + }); + + it('contains button to set up Jira integration', () => { + expect(wrapper.find('a').text()).toBe('Set up Jira Integration'); + }); +}); |