Commit 2174e246 authored by Olena Horal-Koretska's avatar Olena Horal-Koretska

Merge branch 'coverage-fuzzing-help-link' into 'master'

Fix Coverage Fuzzing configuration guide link

See merge request gitlab-org/gitlab!66452
parents 3a46ab2e 148a365b
...@@ -98,6 +98,10 @@ export const COVERAGE_FUZZING_DESCRIPTION = __( ...@@ -98,6 +98,10 @@ export const COVERAGE_FUZZING_DESCRIPTION = __(
export const COVERAGE_FUZZING_HELP_PATH = helpPagePath( export const COVERAGE_FUZZING_HELP_PATH = helpPagePath(
'user/application_security/coverage_fuzzing/index', 'user/application_security/coverage_fuzzing/index',
); );
export const COVERAGE_FUZZING_CONFIG_HELP_PATH = helpPagePath(
'user/application_security/coverage_fuzzing/index',
{ anchor: 'configuration' },
);
export const API_FUZZING_NAME = __('API Fuzzing'); export const API_FUZZING_NAME = __('API Fuzzing');
export const API_FUZZING_DESCRIPTION = __('Find bugs in your code with API fuzzing.'); export const API_FUZZING_DESCRIPTION = __('Find bugs in your code with API fuzzing.');
...@@ -262,6 +266,7 @@ export const securityFeatures = [ ...@@ -262,6 +266,7 @@ export const securityFeatures = [
name: COVERAGE_FUZZING_NAME, name: COVERAGE_FUZZING_NAME,
description: COVERAGE_FUZZING_DESCRIPTION, description: COVERAGE_FUZZING_DESCRIPTION,
helpPath: COVERAGE_FUZZING_HELP_PATH, helpPath: COVERAGE_FUZZING_HELP_PATH,
configurationHelpPath: COVERAGE_FUZZING_CONFIG_HELP_PATH,
type: REPORT_TYPE_COVERAGE_FUZZING, type: REPORT_TYPE_COVERAGE_FUZZING,
}, },
]; ];
......
...@@ -125,7 +125,12 @@ export default { ...@@ -125,7 +125,12 @@ export default {
class="gl-mt-5" class="gl-mt-5"
/> />
<gl-button v-else icon="external-link" :href="feature.configurationHelpPath" class="gl-mt-5"> <gl-button
v-else-if="feature.configurationHelpPath"
icon="external-link"
:href="feature.configurationHelpPath"
class="gl-mt-5"
>
{{ $options.i18n.configurationGuide }} {{ $options.i18n.configurationGuide }}
</gl-button> </gl-button>
</template> </template>
......
...@@ -127,25 +127,35 @@ describe('FeatureCard component', () => { ...@@ -127,25 +127,35 @@ describe('FeatureCard component', () => {
describe('actions', () => { describe('actions', () => {
describe.each` describe.each`
context | type | available | configured | configurationPath | canEnableByMergeRequest | action context | type | available | configured | configurationHelpPath | configurationPath | canEnableByMergeRequest | action
${'unavailable'} | ${REPORT_TYPE_SAST} | ${false} | ${false} | ${null} | ${false} | ${null} ${'unavailable'} | ${REPORT_TYPE_SAST} | ${false} | ${false} | ${'/help'} | ${null} | ${false} | ${null}
${'available'} | ${REPORT_TYPE_SAST} | ${true} | ${false} | ${null} | ${false} | ${'guide'} ${'available, no configurationHelpPath'} | ${REPORT_TYPE_SAST} | ${true} | ${false} | ${null} | ${null} | ${false} | ${null}
${'configured'} | ${REPORT_TYPE_SAST} | ${true} | ${true} | ${null} | ${false} | ${'guide'} ${'available'} | ${REPORT_TYPE_SAST} | ${true} | ${false} | ${'/help'} | ${null} | ${false} | ${'guide'}
${'available, can enable by MR'} | ${REPORT_TYPE_SAST} | ${true} | ${false} | ${null} | ${true} | ${'create-mr'} ${'configured'} | ${REPORT_TYPE_SAST} | ${true} | ${true} | ${'/help'} | ${null} | ${false} | ${'guide'}
${'available, can enable by MR, unknown type'} | ${'foo'} | ${true} | ${false} | ${null} | ${true} | ${'guide'} ${'available, can enable by MR'} | ${REPORT_TYPE_SAST} | ${true} | ${false} | ${'/help'} | ${null} | ${true} | ${'create-mr'}
${'configured, can enable by MR'} | ${REPORT_TYPE_SAST} | ${true} | ${true} | ${null} | ${true} | ${'guide'} ${'available, can enable by MR, unknown type'} | ${'foo'} | ${true} | ${false} | ${'/help'} | ${null} | ${true} | ${'guide'}
${'available with config path'} | ${REPORT_TYPE_SAST} | ${true} | ${false} | ${'foo'} | ${false} | ${'enable'} ${'configured, can enable by MR'} | ${REPORT_TYPE_SAST} | ${true} | ${true} | ${'/help'} | ${null} | ${true} | ${'guide'}
${'available with config path, can enable by MR'} | ${REPORT_TYPE_SAST} | ${true} | ${false} | ${'foo'} | ${true} | ${'enable'} ${'available with config path'} | ${REPORT_TYPE_SAST} | ${true} | ${false} | ${'/help'} | ${'foo'} | ${false} | ${'enable'}
${'configured with config path'} | ${REPORT_TYPE_SAST} | ${true} | ${true} | ${'foo'} | ${false} | ${'configure'} ${'available with config path, can enable by MR'} | ${REPORT_TYPE_SAST} | ${true} | ${false} | ${'/help'} | ${'foo'} | ${true} | ${'enable'}
${'configured with config path, can enable by MR'} | ${REPORT_TYPE_SAST} | ${true} | ${true} | ${'foo'} | ${true} | ${'configure'} ${'configured with config path'} | ${REPORT_TYPE_SAST} | ${true} | ${true} | ${'/help'} | ${'foo'} | ${false} | ${'configure'}
${'configured with config path, can enable by MR'} | ${REPORT_TYPE_SAST} | ${true} | ${true} | ${'/help'} | ${'foo'} | ${true} | ${'configure'}
`( `(
'given $context feature', 'given $context feature',
({ type, available, configured, configurationPath, canEnableByMergeRequest, action }) => { ({
type,
available,
configured,
configurationHelpPath,
configurationPath,
canEnableByMergeRequest,
action,
}) => {
beforeEach(() => { beforeEach(() => {
feature = makeFeature({ feature = makeFeature({
type, type,
available, available,
configured, configured,
configurationHelpPath,
configurationPath, configurationPath,
canEnableByMergeRequest, canEnableByMergeRequest,
}); });
......
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