Commit 3b146415 authored by Daniel Tian's avatar Daniel Tian Committed by Mark Florian

Remove issue note from vulnerability details

parent 407725a6
<script>
import Visibility from 'visibilityjs';
import IssueNote from 'ee/vue_shared/security_reports/components/issue_note.vue';
import SolutionCard from 'ee/vue_shared/security_reports/components/solution_card.vue';
import MergeRequestNote from 'ee/vue_shared/security_reports/components/merge_request_note.vue';
import Api from 'ee/api';
......@@ -18,7 +17,6 @@ import initUserPopovers from '~/user_popovers';
export default {
name: 'VulnerabilityFooter',
components: {
IssueNote,
SolutionCard,
MergeRequestNote,
HistoryEntry,
......@@ -208,18 +206,8 @@ export default {
<div data-qa-selector="vulnerability_footer">
<solution-card v-if="hasSolution" v-bind="solutionInfo" />
<div
v-if="vulnerability.issue_feedback || vulnerability.merge_request_feedback"
class="card gl-mt-5"
>
<issue-note
v-if="vulnerability.issue_feedback"
:feedback="vulnerability.issue_feedback"
:project="project"
class="card-body"
/>
<div v-if="vulnerability.merge_request_feedback" class="card gl-mt-5">
<merge-request-note
v-if="vulnerability.merge_request_feedback"
:feedback="vulnerability.merge_request_feedback"
:project="project"
class="card-body"
......
---
title: Remove issue note from vulnerability details
merge_request: 40686
author:
type: changed
......@@ -6,7 +6,6 @@ import RelatedIssues from 'ee/vulnerabilities/components/related_issues.vue';
import StatusDescription from 'ee/vulnerabilities/components/status_description.vue';
import { VULNERABILITY_STATES } from 'ee/vulnerabilities/constants';
import SolutionCard from 'ee/vue_shared/security_reports/components/solution_card.vue';
import IssueNote from 'ee/vue_shared/security_reports/components/issue_note.vue';
import MergeRequestNote from 'ee/vue_shared/security_reports/components/merge_request_note.vue';
import MockAdapter from 'axios-mock-adapter';
import axios from '~/lib/utils/axios_utils';
......@@ -81,23 +80,21 @@ describe('Vulnerability Footer', () => {
});
});
describe.each`
type | prop | component
${'issue'} | ${'issue_feedback'} | ${IssueNote}
${'merge request'} | ${'merge_request_feedback'} | ${MergeRequestNote}
`('$type note', ({ prop, component }) => {
// The object itself does not matter, we just want to make sure it's passed to the issue note.
const feedback = {};
it('shows issue note when an issue exists for the vulnerability', () => {
createWrapper({ [prop]: feedback });
expect(wrapper.find(component).exists()).toBe(true);
expect(wrapper.find(component).props('feedback')).toBe(feedback);
});
describe('merge request note', () => {
const mergeRequestNote = () => wrapper.find(MergeRequestNote);
it('does not show issue note when there is no issue for the vulnerability', () => {
it('does not show merge request note when a merge request does not exist for the vulnerability', () => {
createWrapper();
expect(wrapper.find(component).exists()).toBe(false);
expect(mergeRequestNote().exists()).toBe(false);
});
it('shows merge request note when a merge request exists for the vulnerability', () => {
// The object itself does not matter, we just want to make sure it's passed to the issue note.
const mergeRequestFeedback = {};
createWrapper({ merge_request_feedback: mergeRequestFeedback });
expect(mergeRequestNote().exists()).toBe(true);
expect(mergeRequestNote().props('feedback')).toBe(mergeRequestFeedback);
});
});
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment