2020-04-22 19:07:51 +05:30
|
|
|
import { GlEmptyState } from '@gitlab/ui';
|
|
|
|
import { shallowMount } from '@vue/test-utils';
|
|
|
|
import JiraImportSetup from '~/jira_import/components/jira_import_setup.vue';
|
2020-07-28 23:09:34 +05:30
|
|
|
import { illustration, jiraIntegrationPath } from '../mock_data';
|
2020-05-24 23:13:21 +05:30
|
|
|
|
2020-04-22 19:07:51 +05:30
|
|
|
describe('JiraImportSetup', () => {
|
|
|
|
let wrapper;
|
|
|
|
|
2020-05-24 23:13:21 +05:30
|
|
|
const getGlEmptyStateProp = attribute => wrapper.find(GlEmptyState).props(attribute);
|
2020-04-22 19:07:51 +05:30
|
|
|
|
|
|
|
beforeEach(() => {
|
|
|
|
wrapper = shallowMount(JiraImportSetup, {
|
|
|
|
propsData: {
|
2020-05-24 23:13:21 +05:30
|
|
|
illustration,
|
|
|
|
jiraIntegrationPath,
|
2020-04-22 19:07:51 +05:30
|
|
|
},
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
afterEach(() => {
|
|
|
|
wrapper.destroy();
|
|
|
|
wrapper = null;
|
|
|
|
});
|
|
|
|
|
|
|
|
it('contains illustration', () => {
|
2020-05-24 23:13:21 +05:30
|
|
|
expect(getGlEmptyStateProp('svgPath')).toBe(illustration);
|
2020-04-22 19:07:51 +05:30
|
|
|
});
|
|
|
|
|
|
|
|
it('contains a description', () => {
|
|
|
|
const description = 'You will first need to set up Jira Integration to use this feature.';
|
2020-05-24 23:13:21 +05:30
|
|
|
expect(getGlEmptyStateProp('description')).toBe(description);
|
2020-04-22 19:07:51 +05:30
|
|
|
});
|
|
|
|
|
|
|
|
it('contains button text', () => {
|
2020-05-24 23:13:21 +05:30
|
|
|
expect(getGlEmptyStateProp('primaryButtonText')).toBe('Set up Jira Integration');
|
|
|
|
});
|
|
|
|
|
|
|
|
it('contains button link', () => {
|
|
|
|
expect(getGlEmptyStateProp('primaryButtonLink')).toBe(jiraIntegrationPath);
|
2020-04-22 19:07:51 +05:30
|
|
|
});
|
|
|
|
});
|