summaryrefslogtreecommitdiff
path: root/spec/frontend
diff options
context:
space:
mode:
authorSam Bigelow <sbigelow@gitlab.com>2019-05-09 15:57:53 -0400
committerSam Bigelow <sbigelow@gitlab.com>2019-05-09 18:39:31 -0400
commitc7d57f2719027388c88e5a87a04003e99db54ec0 (patch)
treebe3314f40423321c6fed47989933712fe590a9bc /spec/frontend
parent84f908fbd69708cb202827eb6d56f82bc00b961c (diff)
downloadgitlab-ce-c7d57f2719027388c88e5a87a04003e99db54ec0.tar.gz
Allow hiding of report status icon in report item61657-allow-report-section-list-to-not-have-redundant-status-icon
Allow hiding of all report items' status icons
Diffstat (limited to 'spec/frontend')
-rw-r--r--spec/frontend/reports/components/report_item_spec.js33
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);
+ });
+ });
+});