Welcome to mirror list, hosted at ThFree Co, Russian Federation.

jira_import_setup_spec.js « components « jira_import « frontend « spec - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 320e270b4934dc1eacdfb2d5887866ad06ebaeeb (plain)
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
import { GlEmptyState } from '@gitlab/ui';
import { shallowMount } from '@vue/test-utils';
import JiraImportSetup from '~/jira_import/components/jira_import_setup.vue';
import { illustration, jiraIntegrationPath } from '../mock_data';

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);
  });
});