diff options
author | Sam Bigelow <sbigelow@gitlab.com> | 2019-05-09 22:57:53 +0300 |
---|---|---|
committer | Sam Bigelow <sbigelow@gitlab.com> | 2019-05-10 01:39:31 +0300 |
commit | c7d57f2719027388c88e5a87a04003e99db54ec0 (patch) | |
tree | be3314f40423321c6fed47989933712fe590a9bc /spec/frontend | |
parent | 84f908fbd69708cb202827eb6d56f82bc00b961c (diff) |
Allow hiding of report status icon in report item
Allow hiding of all report items' status icons
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); + }); + }); +}); |