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

jira_import_app_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: fb3ffe1ede340524309c9ad1f7a32562b2694ebe (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
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);
    });
  });
});