Skip to content
Snippets Groups Projects
Commit e922cea5 authored by Samantha Ming's avatar Samantha Ming
Browse files

Rename vue component to match original name

Issue: #432112
parent c4843b57
No related branches found
No related tags found
1 merge request!137690Rename vue component to match original name
......@@ -5,7 +5,7 @@ import ProjectFilter from '../filters/project_filter.vue';
import ClusterFilter from '../filters/cluster_filter.vue';
import ImageFilter from '../filters/image_filter.vue';
import ToolFilter from '../filters/tool_filter.vue';
import ToolWithScannerFilter from '../filters/tool_with_scanner_filter.vue';
import ToolWithVendorFilter from '../filters/tool_with_vendor_filter.vue';
import SeverityFilter from '../filters/severity_filter.vue';
import StatusFilter from '../filters/status_filter.vue';
import { FILTERS } from './constants';
......@@ -49,7 +49,7 @@ export default {
case FILTERS.TOOL_VENDOR: {
const hasCustomVendor = (vendor) => !DEFAULT_VENDORS.includes(vendor);
return this.scanners.some(({ vendor }) => hasCustomVendor(vendor))
? ToolWithScannerFilter // if there is at least 1 scanner with a custom vendor
? ToolWithVendorFilter // if there is at least 1 scanner with a custom vendor
: ToolFilter;
}
case FILTERS.TOOL_SIMPLE:
......
import { GlCollapsibleListbox } from '@gitlab/ui';
import { nextTick } from 'vue';
import { mountExtended } from 'helpers/vue_test_utils_helper';
import ToolWithScannerFilter from 'ee/security_dashboard/components/shared/filters/tool_with_scanner_filter.vue';
import ToolWithVendorFilter from 'ee/security_dashboard/components/shared/filters/tool_with_vendor_filter.vue';
import { REPORT_TYPES_DEFAULT } from 'ee/security_dashboard/store/constants';
import QuerystringSync from 'ee/security_dashboard/components/shared/filters/querystring_sync.vue';
import { ALL_ID } from 'ee/security_dashboard/components/shared/filters/constants';
......@@ -16,11 +16,11 @@ const MANUALLY_ADDED_OPTION = {
value: 'gitlab-manual-vulnerability-report',
};
describe('Tool With Scanner Filter component', () => {
describe('Tool With Vendor Filter component', () => {
let wrapper;
const createWrapper = ({ scanners = MOCK_SCANNERS } = {}) => {
wrapper = mountExtended(ToolWithScannerFilter, {
wrapper = mountExtended(ToolWithVendorFilter, {
provide: { scanners },
stubs: {
QuerystringSync: true,
......@@ -96,11 +96,11 @@ describe('Tool With Scanner Filter component', () => {
describe('default view', () => {
it('shows the label', () => {
expect(wrapper.find('label').text()).toBe(ToolWithScannerFilter.i18n.label);
expect(wrapper.find('label').text()).toBe(ToolWithVendorFilter.i18n.label);
});
it('shows the dropdown with correct header text', () => {
expect(findListBox().props('headerText')).toBe(ToolWithScannerFilter.i18n.label);
expect(findListBox().props('headerText')).toBe(ToolWithVendorFilter.i18n.label);
});
});
});
......
......@@ -6,7 +6,7 @@ import ProjectFilter from 'ee/security_dashboard/components/shared/filters/proje
import SeverityFilter from 'ee/security_dashboard/components/shared/filters/severity_filter.vue';
import StatusFilter from 'ee/security_dashboard/components/shared/filters/status_filter.vue';
import ToolFilter from 'ee/security_dashboard/components/shared/filters/tool_filter.vue';
import ToolWithScannerFilter from 'ee/security_dashboard/components/shared/filters/tool_with_scanner_filter.vue';
import ToolWithVendorFilter from 'ee/security_dashboard/components/shared/filters/tool_with_vendor_filter.vue';
import { shallowMountExtended } from 'helpers/vue_test_utils_helper';
import { FILTERS } from 'ee/security_dashboard/components/shared/vulnerability_report/constants';
import { MOCK_SCANNERS } from '../filters/mock_data';
......@@ -39,7 +39,7 @@ describe('Vulnerability filters component', () => {
${'status'} | ${[FILTERS.STATUS]} | ${StatusFilter}
${'tool simple'} | ${[FILTERS.TOOL_SIMPLE]} | ${ToolFilter}
${'pipeline tool'} | ${[FILTERS.TOOL_PIPELINE]} | ${ToolFilter}
${'tool with vendor'} | ${[FILTERS.TOOL_VENDOR]} | ${ToolWithScannerFilter}
${'tool with vendor'} | ${[FILTERS.TOOL_VENDOR]} | ${ToolWithVendorFilter}
${'cluster'} | ${[FILTERS.CLUSTER]} | ${ClusterFilter}
${'image'} | ${[FILTERS.IMAGE]} | ${ImageFilter}
`(`shows the expected component for filter '$name'`, ({ filters, expectedComponent }) => {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment