Commit 17779659 authored by Mark Florian's avatar Mark Florian

Conform better to secret detection nomenclature

There are still references like SECRET_SCANNING in the codebase, but
those are _mostly_ to do with user-facing strings which do still display
"Secret scanning", so I've left those as-is.
parent 683fa3d2
...@@ -191,7 +191,7 @@ export default { ...@@ -191,7 +191,7 @@ export default {
'dast', 'dast',
'coverageFuzzing', 'coverageFuzzing',
'dependencyScanning', 'dependencyScanning',
'secretScanning', 'secretDetection',
'summaryCounts', 'summaryCounts',
'modal', 'modal',
'isCreatingIssue', 'isCreatingIssue',
...@@ -215,7 +215,7 @@ export default { ...@@ -215,7 +215,7 @@ export default {
'canDismissVulnerability', 'canDismissVulnerability',
]), ]),
...mapGetters('sast', ['groupedSastText', 'sastStatusIcon']), ...mapGetters('sast', ['groupedSastText', 'sastStatusIcon']),
...mapGetters('secretScanning', ['groupedSecretScanningText', 'secretScanningStatusIcon']), ...mapGetters('secretDetection', ['groupedSecretDetectionText', 'secretDetectionStatusIcon']),
...mapGetters('pipelineJobs', ['hasFuzzingArtifacts', 'fuzzingJobsWithArtifact']), ...mapGetters('pipelineJobs', ['hasFuzzingArtifacts', 'fuzzingJobsWithArtifact']),
securityTab() { securityTab() {
return `${this.pipelinePath}/security`; return `${this.pipelinePath}/security`;
...@@ -307,9 +307,9 @@ export default { ...@@ -307,9 +307,9 @@ export default {
this.fetchDependencyScanningDiff(); this.fetchDependencyScanningDiff();
} }
const secretScanningDiffEndpoint = gl?.mrWidgetData?.secret_scanning_comparison_path; const secretDetectionDiffEndpoint = gl?.mrWidgetData?.secret_scanning_comparison_path;
if (secretScanningDiffEndpoint && this.hasSecretScanningReports) { if (secretDetectionDiffEndpoint && this.hasSecretDetectionReports) {
this.setSecretDetectionDiffEndpoint(secretScanningDiffEndpoint); this.setSecretDetectionDiffEndpoint(secretDetectionDiffEndpoint);
this.fetchSecretDetectionDiff(); this.fetchSecretDetectionDiff();
} }
...@@ -358,7 +358,7 @@ export default { ...@@ -358,7 +358,7 @@ export default {
setSastDiffEndpoint: 'setDiffEndpoint', setSastDiffEndpoint: 'setDiffEndpoint',
fetchSastDiff: 'fetchDiff', fetchSastDiff: 'fetchDiff',
}), }),
...mapActions('secretScanning', { ...mapActions('secretDetection', {
setSecretDetectionDiffEndpoint: 'setDiffEndpoint', setSecretDetectionDiffEndpoint: 'setDiffEndpoint',
fetchSecretDetectionDiff: 'fetchDiff', fetchSecretDetectionDiff: 'fetchDiff',
}), }),
...@@ -532,22 +532,22 @@ export default { ...@@ -532,22 +532,22 @@ export default {
/> />
</template> </template>
<template v-if="hasSecretScanningReports"> <template v-if="hasSecretDetectionReports">
<summary-row <summary-row
:status-icon="secretScanningStatusIcon" :status-icon="secretDetectionStatusIcon"
:popover-options="secretScanningPopover" :popover-options="secretScanningPopover"
class="js-secret-scanning" class="js-secret-scanning"
data-qa-selector="secret_scan_report" data-qa-selector="secret_scan_report"
> >
<template #summary> <template #summary>
<security-summary :message="groupedSecretScanningText" /> <security-summary :message="groupedSecretDetectionText" />
</template> </template>
</summary-row> </summary-row>
<grouped-issues-list <grouped-issues-list
v-if="secretScanning.newIssues.length || secretScanning.resolvedIssues.length" v-if="secretDetection.newIssues.length || secretDetection.resolvedIssues.length"
:unresolved-issues="secretScanning.newIssues" :unresolved-issues="secretDetection.newIssues"
:resolved-issues="secretScanning.resolvedIssues" :resolved-issues="secretDetection.resolvedIssues"
:component="$options.componentNames.SecurityIssueBody" :component="$options.componentNames.SecurityIssueBody"
class="report-block-group-list" class="report-block-group-list"
data-testid="secret-scanning-issues-list" data-testid="secret-scanning-issues-list"
......
...@@ -35,7 +35,7 @@ export const summaryCounts = ({ ...@@ -35,7 +35,7 @@ export const summaryCounts = ({
dast, dast,
dependencyScanning, dependencyScanning,
sast, sast,
secretScanning, secretDetection,
coverageFuzzing, coverageFuzzing,
} = {}) => { } = {}) => {
const allNewVulns = [ const allNewVulns = [
...@@ -43,7 +43,7 @@ export const summaryCounts = ({ ...@@ -43,7 +43,7 @@ export const summaryCounts = ({
...dast.newIssues, ...dast.newIssues,
...dependencyScanning.newIssues, ...dependencyScanning.newIssues,
...sast.newIssues, ...sast.newIssues,
...secretScanning.newIssues, ...secretDetection.newIssues,
...coverageFuzzing.newIssues, ...coverageFuzzing.newIssues,
]; ];
...@@ -114,7 +114,7 @@ export const areReportsLoading = state => ...@@ -114,7 +114,7 @@ export const areReportsLoading = state =>
state.dast.isLoading || state.dast.isLoading ||
state.containerScanning.isLoading || state.containerScanning.isLoading ||
state.dependencyScanning.isLoading || state.dependencyScanning.isLoading ||
state.secretScanning.isLoading || state.secretDetection.isLoading ||
state.coverageFuzzing.isLoading; state.coverageFuzzing.isLoading;
export const areAllReportsLoading = state => export const areAllReportsLoading = state =>
...@@ -122,7 +122,7 @@ export const areAllReportsLoading = state => ...@@ -122,7 +122,7 @@ export const areAllReportsLoading = state =>
state.dast.isLoading && state.dast.isLoading &&
state.containerScanning.isLoading && state.containerScanning.isLoading &&
state.dependencyScanning.isLoading && state.dependencyScanning.isLoading &&
state.secretScanning.isLoading && state.secretDetection.isLoading &&
state.coverageFuzzing.isLoading; state.coverageFuzzing.isLoading;
export const allReportsHaveError = state => export const allReportsHaveError = state =>
...@@ -130,7 +130,7 @@ export const allReportsHaveError = state => ...@@ -130,7 +130,7 @@ export const allReportsHaveError = state =>
state.dast.hasError && state.dast.hasError &&
state.containerScanning.hasError && state.containerScanning.hasError &&
state.dependencyScanning.hasError && state.dependencyScanning.hasError &&
state.secretScanning.hasError && state.secretDetection.hasError &&
state.coverageFuzzing.hasError; state.coverageFuzzing.hasError;
export const anyReportHasError = state => export const anyReportHasError = state =>
...@@ -138,7 +138,7 @@ export const anyReportHasError = state => ...@@ -138,7 +138,7 @@ export const anyReportHasError = state =>
state.dast.hasError || state.dast.hasError ||
state.containerScanning.hasError || state.containerScanning.hasError ||
state.dependencyScanning.hasError || state.dependencyScanning.hasError ||
state.secretScanning.hasError || state.secretDetection.hasError ||
state.coverageFuzzing.hasError; state.coverageFuzzing.hasError;
export const noBaseInAllReports = state => export const noBaseInAllReports = state =>
...@@ -146,7 +146,7 @@ export const noBaseInAllReports = state => ...@@ -146,7 +146,7 @@ export const noBaseInAllReports = state =>
!state.dast.hasBaseReport && !state.dast.hasBaseReport &&
!state.containerScanning.hasBaseReport && !state.containerScanning.hasBaseReport &&
!state.dependencyScanning.hasBaseReport && !state.dependencyScanning.hasBaseReport &&
!state.secretScanning.hasBaseReport && !state.secretDetection.hasBaseReport &&
!state.coverageFuzzing.hasBaseReport; !state.coverageFuzzing.hasBaseReport;
export const anyReportHasIssues = state => export const anyReportHasIssues = state =>
...@@ -154,7 +154,7 @@ export const anyReportHasIssues = state => ...@@ -154,7 +154,7 @@ export const anyReportHasIssues = state =>
state.dast.newIssues.length > 0 || state.dast.newIssues.length > 0 ||
state.containerScanning.newIssues.length > 0 || state.containerScanning.newIssues.length > 0 ||
state.dependencyScanning.newIssues.length > 0 || state.dependencyScanning.newIssues.length > 0 ||
state.secretScanning.newIssues.length > 0 || state.secretDetection.newIssues.length > 0 ||
state.coverageFuzzing.newIssues.length > 0; state.coverageFuzzing.newIssues.length > 0;
export const isBaseSecurityReportOutOfDate = state => export const isBaseSecurityReportOutOfDate = state =>
...@@ -162,7 +162,7 @@ export const isBaseSecurityReportOutOfDate = state => ...@@ -162,7 +162,7 @@ export const isBaseSecurityReportOutOfDate = state =>
state.dast.baseReportOutofDate || state.dast.baseReportOutofDate ||
state.containerScanning.baseReportOutofDate || state.containerScanning.baseReportOutofDate ||
state.dependencyScanning.baseReportOutofDate || state.dependencyScanning.baseReportOutofDate ||
state.secretScanning.baseReportOutofDate || state.secretDetection.baseReportOutofDate ||
state.coverageFuzzing.baseReportOutofDate; state.coverageFuzzing.baseReportOutofDate;
export const canCreateIssue = state => Boolean(state.createVulnerabilityFeedbackIssuePath); export const canCreateIssue = state => Boolean(state.createVulnerabilityFeedbackIssuePath);
......
...@@ -8,7 +8,7 @@ import mutations from './mutations'; ...@@ -8,7 +8,7 @@ import mutations from './mutations';
import state from './state'; import state from './state';
import sast from './modules/sast'; import sast from './modules/sast';
import secretScanning from './modules/secret_detection'; import secretDetection from './modules/secret_detection';
Vue.use(Vuex); Vue.use(Vuex);
...@@ -16,7 +16,7 @@ export default () => ...@@ -16,7 +16,7 @@ export default () =>
new Vuex.Store({ new Vuex.Store({
modules: { modules: {
sast, sast,
secretScanning, secretDetection,
pipelineJobs, pipelineJobs,
}, },
actions, actions,
......
...@@ -5,7 +5,7 @@ export const updateIssueActionsMap = { ...@@ -5,7 +5,7 @@ export const updateIssueActionsMap = {
dependency_scanning: 'updateDependencyScanningIssue', dependency_scanning: 'updateDependencyScanningIssue',
container_scanning: 'updateContainerScanningIssue', container_scanning: 'updateContainerScanningIssue',
dast: 'updateDastIssue', dast: 'updateDastIssue',
secret_detection: 'secretScanning/updateVulnerability', secret_detection: 'secretDetection/updateVulnerability',
coverage_fuzzing: 'updateCoverageFuzzingIssue', coverage_fuzzing: 'updateCoverageFuzzingIssue',
}; };
......
import { statusIcon, groupedReportText } from '../../utils'; import { statusIcon, groupedReportText } from '../../utils';
import messages from '../../messages'; import messages from '../../messages';
export const groupedSecretScanningText = state => export const groupedSecretDetectionText = state =>
groupedReportText( groupedReportText(
state, state,
messages.SECRET_SCANNING, messages.SECRET_SCANNING,
...@@ -9,5 +9,5 @@ export const groupedSecretScanningText = state => ...@@ -9,5 +9,5 @@ export const groupedSecretScanningText = state =>
messages.SECRET_SCANNING_IS_LOADING, messages.SECRET_SCANNING_IS_LOADING,
); );
export const secretScanningStatusIcon = ({ isLoading, hasError, newIssues }) => export const secretDetectionStatusIcon = ({ isLoading, hasError, newIssues }) =>
statusIcon(isLoading, hasError, newIssues.length); statusIcon(isLoading, hasError, newIssues.length);
...@@ -10,7 +10,7 @@ export default { ...@@ -10,7 +10,7 @@ export default {
dast: false, dast: false,
dependency_scanning: false, dependency_scanning: false,
license_management: false, license_management: false,
secret_scanning: false, secret_detection: false,
}, },
}; };
......
...@@ -4,7 +4,7 @@ import GroupedSecurityReportsApp from 'ee/vue_shared/security_reports/grouped_se ...@@ -4,7 +4,7 @@ import GroupedSecurityReportsApp from 'ee/vue_shared/security_reports/grouped_se
import appStore from 'ee/vue_shared/security_reports/store'; import appStore from 'ee/vue_shared/security_reports/store';
import * as types from 'ee/vue_shared/security_reports/store/mutation_types'; import * as types from 'ee/vue_shared/security_reports/store/mutation_types';
import * as sastTypes from 'ee/vue_shared/security_reports/store/modules/sast/mutation_types'; import * as sastTypes from 'ee/vue_shared/security_reports/store/modules/sast/mutation_types';
import * as secretScanningTypes from 'ee/vue_shared/security_reports/store/modules/secret_detection/mutation_types'; import * as secretDetectionTypes from 'ee/vue_shared/security_reports/store/modules/secret_detection/mutation_types';
import { mount } from '@vue/test-utils'; import { mount } from '@vue/test-utils';
import { waitForMutation } from 'helpers/vue_test_utils_helper'; import { waitForMutation } from 'helpers/vue_test_utils_helper';
import { trimText } from 'helpers/text_helper'; import { trimText } from 'helpers/text_helper';
...@@ -30,7 +30,7 @@ const DEPENDENCY_SCANNING_DIFF_ENDPOINT = 'dependency_scanning.json'; ...@@ -30,7 +30,7 @@ const DEPENDENCY_SCANNING_DIFF_ENDPOINT = 'dependency_scanning.json';
const DAST_DIFF_ENDPOINT = 'dast.json'; const DAST_DIFF_ENDPOINT = 'dast.json';
const SAST_DIFF_ENDPOINT = 'sast.json'; const SAST_DIFF_ENDPOINT = 'sast.json';
const PIPELINE_JOBS_ENDPOINT = 'jobs.json'; const PIPELINE_JOBS_ENDPOINT = 'jobs.json';
const SECRET_SCANNING_DIFF_ENDPOINT = 'secret_detection.json'; const SECRET_DETECTION_DIFF_ENDPOINT = 'secret_detection.json';
const COVERAGE_FUZZING_DIFF_ENDPOINT = 'coverage_fuzzing.json'; const COVERAGE_FUZZING_DIFF_ENDPOINT = 'coverage_fuzzing.json';
describe('Grouped security reports app', () => { describe('Grouped security reports app', () => {
...@@ -118,7 +118,7 @@ describe('Grouped security reports app', () => { ...@@ -118,7 +118,7 @@ describe('Grouped security reports app', () => {
gl.mrWidgetData.dependency_scanning_comparison_path = DEPENDENCY_SCANNING_DIFF_ENDPOINT; gl.mrWidgetData.dependency_scanning_comparison_path = DEPENDENCY_SCANNING_DIFF_ENDPOINT;
gl.mrWidgetData.dast_comparison_path = DAST_DIFF_ENDPOINT; gl.mrWidgetData.dast_comparison_path = DAST_DIFF_ENDPOINT;
gl.mrWidgetData.sast_comparison_path = SAST_DIFF_ENDPOINT; gl.mrWidgetData.sast_comparison_path = SAST_DIFF_ENDPOINT;
gl.mrWidgetData.secret_scanning_comparison_path = SECRET_SCANNING_DIFF_ENDPOINT; gl.mrWidgetData.secret_scanning_comparison_path = SECRET_DETECTION_DIFF_ENDPOINT;
gl.mrWidgetData.coverage_fuzzing_comparison_path = COVERAGE_FUZZING_DIFF_ENDPOINT; gl.mrWidgetData.coverage_fuzzing_comparison_path = COVERAGE_FUZZING_DIFF_ENDPOINT;
}); });
...@@ -128,7 +128,7 @@ describe('Grouped security reports app', () => { ...@@ -128,7 +128,7 @@ describe('Grouped security reports app', () => {
mock.onGet(DEPENDENCY_SCANNING_DIFF_ENDPOINT).reply(500); mock.onGet(DEPENDENCY_SCANNING_DIFF_ENDPOINT).reply(500);
mock.onGet(DAST_DIFF_ENDPOINT).reply(500); mock.onGet(DAST_DIFF_ENDPOINT).reply(500);
mock.onGet(SAST_DIFF_ENDPOINT).reply(500); mock.onGet(SAST_DIFF_ENDPOINT).reply(500);
mock.onGet(SECRET_SCANNING_DIFF_ENDPOINT).reply(500); mock.onGet(SECRET_DETECTION_DIFF_ENDPOINT).reply(500);
mock.onGet(COVERAGE_FUZZING_DIFF_ENDPOINT).reply(500); mock.onGet(COVERAGE_FUZZING_DIFF_ENDPOINT).reply(500);
createWrapper(allReportProps); createWrapper(allReportProps);
...@@ -140,7 +140,7 @@ describe('Grouped security reports app', () => { ...@@ -140,7 +140,7 @@ describe('Grouped security reports app', () => {
waitForMutation(wrapper.vm.$store, types.RECEIVE_DEPENDENCY_SCANNING_DIFF_ERROR), waitForMutation(wrapper.vm.$store, types.RECEIVE_DEPENDENCY_SCANNING_DIFF_ERROR),
waitForMutation( waitForMutation(
wrapper.vm.$store, wrapper.vm.$store,
`secretScanning/${secretScanningTypes.RECEIVE_DIFF_ERROR}`, `secretDetection/${secretDetectionTypes.RECEIVE_DIFF_ERROR}`,
), ),
waitForMutation(wrapper.vm.$store, types.RECEIVE_COVERAGE_FUZZING_DIFF_ERROR), waitForMutation(wrapper.vm.$store, types.RECEIVE_COVERAGE_FUZZING_DIFF_ERROR),
]); ]);
...@@ -183,7 +183,7 @@ describe('Grouped security reports app', () => { ...@@ -183,7 +183,7 @@ describe('Grouped security reports app', () => {
mock.onGet(DEPENDENCY_SCANNING_DIFF_ENDPOINT).reply(200, {}); mock.onGet(DEPENDENCY_SCANNING_DIFF_ENDPOINT).reply(200, {});
mock.onGet(DAST_DIFF_ENDPOINT).reply(200, {}); mock.onGet(DAST_DIFF_ENDPOINT).reply(200, {});
mock.onGet(SAST_DIFF_ENDPOINT).reply(200, {}); mock.onGet(SAST_DIFF_ENDPOINT).reply(200, {});
mock.onGet(SECRET_SCANNING_DIFF_ENDPOINT).reply(200, {}); mock.onGet(SECRET_DETECTION_DIFF_ENDPOINT).reply(200, {});
mock.onGet(COVERAGE_FUZZING_DIFF_ENDPOINT).reply(200, {}); mock.onGet(COVERAGE_FUZZING_DIFF_ENDPOINT).reply(200, {});
createWrapper(allReportProps); createWrapper(allReportProps);
...@@ -216,7 +216,7 @@ describe('Grouped security reports app', () => { ...@@ -216,7 +216,7 @@ describe('Grouped security reports app', () => {
mock.onGet(DEPENDENCY_SCANNING_DIFF_ENDPOINT).reply(200, emptyResponse); mock.onGet(DEPENDENCY_SCANNING_DIFF_ENDPOINT).reply(200, emptyResponse);
mock.onGet(DAST_DIFF_ENDPOINT).reply(200, emptyResponse); mock.onGet(DAST_DIFF_ENDPOINT).reply(200, emptyResponse);
mock.onGet(SAST_DIFF_ENDPOINT).reply(200, emptyResponse); mock.onGet(SAST_DIFF_ENDPOINT).reply(200, emptyResponse);
mock.onGet(SECRET_SCANNING_DIFF_ENDPOINT).reply(200, emptyResponse); mock.onGet(SECRET_DETECTION_DIFF_ENDPOINT).reply(200, emptyResponse);
mock.onGet(COVERAGE_FUZZING_DIFF_ENDPOINT).reply(200, emptyResponse); mock.onGet(COVERAGE_FUZZING_DIFF_ENDPOINT).reply(200, emptyResponse);
createWrapper(allReportProps); createWrapper(allReportProps);
...@@ -228,7 +228,7 @@ describe('Grouped security reports app', () => { ...@@ -228,7 +228,7 @@ describe('Grouped security reports app', () => {
waitForMutation(wrapper.vm.$store, types.RECEIVE_DEPENDENCY_SCANNING_DIFF_SUCCESS), waitForMutation(wrapper.vm.$store, types.RECEIVE_DEPENDENCY_SCANNING_DIFF_SUCCESS),
waitForMutation( waitForMutation(
wrapper.vm.$store, wrapper.vm.$store,
`secretScanning/${secretScanningTypes.RECEIVE_DIFF_SUCCESS}`, `secretDetection/${secretDetectionTypes.RECEIVE_DIFF_SUCCESS}`,
), ),
waitForMutation(wrapper.vm.$store, types.RECEIVE_COVERAGE_FUZZING_DIFF_SUCCESS), waitForMutation(wrapper.vm.$store, types.RECEIVE_COVERAGE_FUZZING_DIFF_SUCCESS),
]); ]);
...@@ -269,7 +269,7 @@ describe('Grouped security reports app', () => { ...@@ -269,7 +269,7 @@ describe('Grouped security reports app', () => {
mock.onGet(DEPENDENCY_SCANNING_DIFF_ENDPOINT).reply(200, dependencyScanningDiffSuccessMock); mock.onGet(DEPENDENCY_SCANNING_DIFF_ENDPOINT).reply(200, dependencyScanningDiffSuccessMock);
mock.onGet(DAST_DIFF_ENDPOINT).reply(200, dastDiffSuccessMock); mock.onGet(DAST_DIFF_ENDPOINT).reply(200, dastDiffSuccessMock);
mock.onGet(SAST_DIFF_ENDPOINT).reply(200, sastDiffSuccessMock); mock.onGet(SAST_DIFF_ENDPOINT).reply(200, sastDiffSuccessMock);
mock.onGet(SECRET_SCANNING_DIFF_ENDPOINT).reply(200, secretScanningDiffSuccessMock); mock.onGet(SECRET_DETECTION_DIFF_ENDPOINT).reply(200, secretScanningDiffSuccessMock);
mock.onGet(COVERAGE_FUZZING_DIFF_ENDPOINT).reply(200, coverageFuzzingDiffSuccessMock); mock.onGet(COVERAGE_FUZZING_DIFF_ENDPOINT).reply(200, coverageFuzzingDiffSuccessMock);
createWrapper(allReportProps); createWrapper(allReportProps);
...@@ -281,7 +281,7 @@ describe('Grouped security reports app', () => { ...@@ -281,7 +281,7 @@ describe('Grouped security reports app', () => {
waitForMutation(wrapper.vm.$store, types.RECEIVE_DEPENDENCY_SCANNING_DIFF_SUCCESS), waitForMutation(wrapper.vm.$store, types.RECEIVE_DEPENDENCY_SCANNING_DIFF_SUCCESS),
waitForMutation( waitForMutation(
wrapper.vm.$store, wrapper.vm.$store,
`secretScanning/${secretScanningTypes.RECEIVE_DIFF_SUCCESS}`, `secretDetection/${secretDetectionTypes.RECEIVE_DIFF_SUCCESS}`,
), ),
waitForMutation(wrapper.vm.$store, types.RECEIVE_COVERAGE_FUZZING_DIFF_SUCCESS), waitForMutation(wrapper.vm.$store, types.RECEIVE_COVERAGE_FUZZING_DIFF_SUCCESS),
]); ]);
...@@ -563,9 +563,9 @@ describe('Grouped security reports app', () => { ...@@ -563,9 +563,9 @@ describe('Grouped security reports app', () => {
describe('secret scanning reports', () => { describe('secret scanning reports', () => {
const initSecretScan = (isEnabled = true) => { const initSecretScan = (isEnabled = true) => {
gl.mrWidgetData = gl.mrWidgetData || {}; gl.mrWidgetData = gl.mrWidgetData || {};
gl.mrWidgetData.secret_scanning_comparison_path = SECRET_SCANNING_DIFF_ENDPOINT; gl.mrWidgetData.secret_scanning_comparison_path = SECRET_DETECTION_DIFF_ENDPOINT;
mock.onGet(SECRET_SCANNING_DIFF_ENDPOINT).reply(200, secretScanningDiffSuccessMock); mock.onGet(SECRET_DETECTION_DIFF_ENDPOINT).reply(200, secretScanningDiffSuccessMock);
createWrapper({ createWrapper({
...props, ...props,
...@@ -576,7 +576,7 @@ describe('Grouped security reports app', () => { ...@@ -576,7 +576,7 @@ describe('Grouped security reports app', () => {
return waitForMutation( return waitForMutation(
wrapper.vm.$store, wrapper.vm.$store,
`secretScanning/${secretScanningTypes.RECEIVE_DIFF_SUCCESS}`, `secretDetection/${secretDetectionTypes.RECEIVE_DIFF_SUCCESS}`,
); );
}; };
...@@ -589,8 +589,10 @@ describe('Grouped security reports app', () => { ...@@ -589,8 +589,10 @@ describe('Grouped security reports app', () => {
expect(wrapper.find('[data-qa-selector="secret_scan_report"]').exists()).toBe(true); expect(wrapper.find('[data-qa-selector="secret_scan_report"]').exists()).toBe(true);
}); });
it('should set setDiffEndpoint', () => { it('should set diffEndpoint', () => {
expect(wrapper.vm.secretScanning.paths.diffEndpoint).toEqual(SECRET_SCANNING_DIFF_ENDPOINT); expect(wrapper.vm.secretDetection.paths.diffEndpoint).toEqual(
SECRET_DETECTION_DIFF_ENDPOINT,
);
}); });
it('should display the correct numbers of vulnerabilities', () => { it('should display the correct numbers of vulnerabilities', () => {
......
...@@ -38,7 +38,7 @@ describe('Security reports getters', () => { ...@@ -38,7 +38,7 @@ describe('Security reports getters', () => {
beforeEach(() => { beforeEach(() => {
state = createState(); state = createState();
state.sast = createSastState(); state.sast = createSastState();
state.secretScanning = createSecretScanningState(); state.secretDetection = createSecretScanningState();
}); });
describe.each` describe.each`
...@@ -220,7 +220,7 @@ describe('Security reports getters', () => { ...@@ -220,7 +220,7 @@ describe('Security reports getters', () => {
state.dast.hasError = true; state.dast.hasError = true;
state.containerScanning.hasError = true; state.containerScanning.hasError = true;
state.dependencyScanning.hasError = true; state.dependencyScanning.hasError = true;
state.secretScanning.hasError = true; state.secretDetection.hasError = true;
state.coverageFuzzing.hasError = true; state.coverageFuzzing.hasError = true;
expect(allReportsHaveError(state)).toEqual(true); expect(allReportsHaveError(state)).toEqual(true);
...@@ -234,7 +234,7 @@ describe('Security reports getters', () => { ...@@ -234,7 +234,7 @@ describe('Security reports getters', () => {
state.dast.hasError = false; state.dast.hasError = false;
state.containerScanning.hasError = true; state.containerScanning.hasError = true;
state.dependencyScanning.hasError = true; state.dependencyScanning.hasError = true;
state.secretScanning.hasError = true; state.secretDetection.hasError = true;
expect(allReportsHaveError(state)).toEqual(false); expect(allReportsHaveError(state)).toEqual(false);
}); });
......
...@@ -7,24 +7,24 @@ const createReport = (config = {}) => ({ ...@@ -7,24 +7,24 @@ const createReport = (config = {}) => ({
...config, ...config,
}); });
describe('groupedSecretScanningText', () => { describe('groupedSecretDetectionText', () => {
it("should return the error message if there's an error", () => { it("should return the error message if there's an error", () => {
const report = createReport({ hasError: true }); const report = createReport({ hasError: true });
const result = getters.groupedSecretScanningText(report); const result = getters.groupedSecretDetectionText(report);
expect(result).toStrictEqual({ message: messages.SECRET_SCANNING_HAS_ERROR }); expect(result).toStrictEqual({ message: messages.SECRET_SCANNING_HAS_ERROR });
}); });
it("should return the loading message if it's still loading", () => { it("should return the loading message if it's still loading", () => {
const report = createReport({ isLoading: true }); const report = createReport({ isLoading: true });
const result = getters.groupedSecretScanningText(report); const result = getters.groupedSecretDetectionText(report);
expect(result).toStrictEqual({ message: messages.SECRET_SCANNING_IS_LOADING }); expect(result).toStrictEqual({ message: messages.SECRET_SCANNING_IS_LOADING });
}); });
it('should call groupedTextBuilder if everything is fine', () => { it('should call groupedTextBuilder if everything is fine', () => {
const report = createReport(); const report = createReport();
const result = getters.groupedSecretScanningText(report); const result = getters.groupedSecretDetectionText(report);
expect(result).toStrictEqual({ expect(result).toStrictEqual({
countMessage: '', countMessage: '',
...@@ -38,24 +38,24 @@ describe('groupedSecretScanningText', () => { ...@@ -38,24 +38,24 @@ describe('groupedSecretScanningText', () => {
}); });
}); });
describe('secretScanningStatusIcon', () => { describe('secretDetectionStatusIcon', () => {
it("should return `loading` when we're still loading", () => { it("should return `loading` when we're still loading", () => {
const report = createReport({ isLoading: true }); const report = createReport({ isLoading: true });
const result = getters.secretScanningStatusIcon(report); const result = getters.secretDetectionStatusIcon(report);
expect(result).toBe('loading'); expect(result).toBe('loading');
}); });
it("should return `warning` when there's an issue", () => { it("should return `warning` when there's an issue", () => {
const report = createReport({ hasError: true }); const report = createReport({ hasError: true });
const result = getters.secretScanningStatusIcon(report); const result = getters.secretDetectionStatusIcon(report);
expect(result).toBe('warning'); expect(result).toBe('warning');
}); });
it('should return `success` when nothing is wrong', () => { it('should return `success` when nothing is wrong', () => {
const report = createReport(); const report = createReport();
const result = getters.secretScanningStatusIcon(report); const result = getters.secretDetectionStatusIcon(report);
expect(result).toBe('success'); expect(result).toBe('success');
}); });
......
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