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

report_item_spec.js « components « reports « frontend « spec - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 60c7e5f2b44dc18715dd254a8457b342dcd0fd8b (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
import { shallowMount } from '@vue/test-utils';
import { componentNames } from '~/reports/components/issue_body';
import IssueStatusIcon from '~/reports/components/issue_status_icon.vue';
import ReportItem from '~/reports/components/report_item.vue';
import { STATUS_SUCCESS } from '~/reports/constants';

describe('ReportItem', () => {
  describe('showReportSectionStatusIcon', () => {
    it('does not render CI Status Icon when showReportSectionStatusIcon is false', () => {
      const wrapper = shallowMount(ReportItem, {
        propsData: {
          issue: { foo: 'bar' },
          component: componentNames.CodequalityIssueBody,
          status: STATUS_SUCCESS,
          showReportSectionStatusIcon: false,
        },
      });

      expect(wrapper.findComponent(IssueStatusIcon).exists()).toBe(false);
    });

    it('shows status icon when unspecified', () => {
      const wrapper = shallowMount(ReportItem, {
        propsData: {
          issue: { foo: 'bar' },
          component: componentNames.CodequalityIssueBody,
          status: STATUS_SUCCESS,
        },
      });

      expect(wrapper.findComponent(IssueStatusIcon).exists()).toBe(true);
    });
  });
});