2019-05-09 19:57:53 +00:00
|
|
|
import { shallowMount } from '@vue/test-utils';
|
|
|
|
import { componentNames } from '~/reports/components/issue_body';
|
2021-02-14 18:09:20 +00:00
|
|
|
import IssueStatusIcon from '~/reports/components/issue_status_icon.vue';
|
|
|
|
import ReportItem from '~/reports/components/report_item.vue';
|
|
|
|
import { STATUS_SUCCESS } from '~/reports/constants';
|
2019-05-09 19:57:53 +00:00
|
|
|
|
|
|
|
describe('ReportItem', () => {
|
|
|
|
describe('showReportSectionStatusIcon', () => {
|
|
|
|
it('does not render CI Status Icon when showReportSectionStatusIcon is false', () => {
|
|
|
|
const wrapper = shallowMount(ReportItem, {
|
|
|
|
propsData: {
|
|
|
|
issue: { foo: 'bar' },
|
2022-11-07 06:08:10 +00:00
|
|
|
component: componentNames.CodequalityIssueBody,
|
2019-05-09 19:57:53 +00:00
|
|
|
status: STATUS_SUCCESS,
|
|
|
|
showReportSectionStatusIcon: false,
|
|
|
|
},
|
|
|
|
});
|
|
|
|
|
2022-09-12 15:14:03 +00:00
|
|
|
expect(wrapper.findComponent(IssueStatusIcon).exists()).toBe(false);
|
2019-05-09 19:57:53 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
it('shows status icon when unspecified', () => {
|
|
|
|
const wrapper = shallowMount(ReportItem, {
|
|
|
|
propsData: {
|
|
|
|
issue: { foo: 'bar' },
|
2022-11-07 06:08:10 +00:00
|
|
|
component: componentNames.CodequalityIssueBody,
|
2019-05-09 19:57:53 +00:00
|
|
|
status: STATUS_SUCCESS,
|
|
|
|
},
|
|
|
|
});
|
|
|
|
|
2022-09-12 15:14:03 +00:00
|
|
|
expect(wrapper.findComponent(IssueStatusIcon).exists()).toBe(true);
|
2019-05-09 19:57:53 +00:00
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|