debian-mirror-gitlab/spec/frontend/jira_import/components/jira_import_setup_spec.js
2020-05-24 23:13:21 +05:30

44 lines
1.2 KiB
JavaScript

import { GlEmptyState } from '@gitlab/ui';
import { shallowMount } from '@vue/test-utils';
import JiraImportSetup from '~/jira_import/components/jira_import_setup.vue';
const illustration = 'illustration.svg';
const jiraIntegrationPath = 'gitlab-org/gitlab-test/-/services/jira/edit';
describe('JiraImportSetup', () => {
let wrapper;
const getGlEmptyStateProp = attribute => wrapper.find(GlEmptyState).props(attribute);
beforeEach(() => {
wrapper = shallowMount(JiraImportSetup, {
propsData: {
illustration,
jiraIntegrationPath,
},
});
});
afterEach(() => {
wrapper.destroy();
wrapper = null;
});
it('contains illustration', () => {
expect(getGlEmptyStateProp('svgPath')).toBe(illustration);
});
it('contains a description', () => {
const description = 'You will first need to set up Jira Integration to use this feature.';
expect(getGlEmptyStateProp('description')).toBe(description);
});
it('contains button text', () => {
expect(getGlEmptyStateProp('primaryButtonText')).toBe('Set up Jira Integration');
});
it('contains button link', () => {
expect(getGlEmptyStateProp('primaryButtonLink')).toBe(jiraIntegrationPath);
});
});