diff options
Diffstat (limited to 'spec/frontend')
-rw-r--r-- | spec/frontend/reports/components/report_item_spec.js | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/spec/frontend/reports/components/report_item_spec.js b/spec/frontend/reports/components/report_item_spec.js new file mode 100644 index 00000000000..bacbb399513 --- /dev/null +++ b/spec/frontend/reports/components/report_item_spec.js @@ -0,0 +1,33 @@ +import { shallowMount } from '@vue/test-utils'; +import { STATUS_SUCCESS } from '~/reports/constants'; +import ReportItem from '~/reports/components/report_item.vue'; +import { componentNames } from '~/reports/components/issue_body'; + +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.TestIssueBody, + status: STATUS_SUCCESS, + showReportSectionStatusIcon: false, + }, + }); + + expect(wrapper.find('issuestatusicon-stub').exists()).toBe(false); + }); + + it('shows status icon when unspecified', () => { + const wrapper = shallowMount(ReportItem, { + propsData: { + issue: { foo: 'bar' }, + component: componentNames.TestIssueBody, + status: STATUS_SUCCESS, + }, + }); + + expect(wrapper.find('issuestatusicon-stub').exists()).toBe(true); + }); + }); +}); |