Commit d0670607 authored by Jannik Lehmann's avatar Jannik Lehmann Committed by Mark Florian

Fix inline Link on Security Configuration CE Page

parent 66fb025c
...@@ -83,7 +83,8 @@ export default { ...@@ -83,7 +83,8 @@ export default {
{{ item.description }} {{ item.description }}
<gl-link <gl-link
target="_blank" target="_blank"
:href="item.link" data-testid="help-link"
:href="item.helpPath"
:aria-label="getFeatureDocumentationLinkLabel(item)" :aria-label="getFeatureDocumentationLinkLabel(item)"
> >
{{ s__('SecurityConfiguration|More information') }} {{ s__('SecurityConfiguration|More information') }}
......
...@@ -5,12 +5,7 @@ import { features, UPGRADE_CTA } from '~/security_configuration/components/featu ...@@ -5,12 +5,7 @@ import { features, UPGRADE_CTA } from '~/security_configuration/components/featu
import { import {
REPORT_TYPE_SAST, REPORT_TYPE_SAST,
REPORT_TYPE_DAST, REPORT_TYPE_SECRET_DETECTION,
REPORT_TYPE_DAST_PROFILES,
REPORT_TYPE_DEPENDENCY_SCANNING,
REPORT_TYPE_CONTAINER_SCANNING,
REPORT_TYPE_COVERAGE_FUZZING,
REPORT_TYPE_LICENSE_COMPLIANCE,
} from '~/vue_shared/security_reports/constants'; } from '~/vue_shared/security_reports/constants';
describe('Configuration Table Component', () => { describe('Configuration Table Component', () => {
...@@ -20,6 +15,8 @@ describe('Configuration Table Component', () => { ...@@ -20,6 +15,8 @@ describe('Configuration Table Component', () => {
wrapper = extendedWrapper(mount(ConfigurationTable, {})); wrapper = extendedWrapper(mount(ConfigurationTable, {}));
}; };
const findHelpLinks = () => wrapper.findAll('[data-testid="help-link"]');
afterEach(() => { afterEach(() => {
wrapper.destroy(); wrapper.destroy();
}); });
...@@ -28,23 +25,20 @@ describe('Configuration Table Component', () => { ...@@ -28,23 +25,20 @@ describe('Configuration Table Component', () => {
createComponent(); createComponent();
}); });
it.each(features)('should match strings', (feature) => { describe.each(features.map((feature, i) => [feature, i]))('given feature %s', (feature, i) => {
expect(wrapper.text()).toContain(feature.name); it('should match strings', () => {
expect(wrapper.text()).toContain(feature.description); expect(wrapper.text()).toContain(feature.name);
expect(wrapper.text()).toContain(feature.description);
if (feature.type === REPORT_TYPE_SAST) { if (feature.type === REPORT_TYPE_SAST) {
expect(wrapper.findByTestId(feature.type).text()).toBe('Configure via Merge Request'); expect(wrapper.findByTestId(feature.type).text()).toBe('Configure via Merge Request');
} else if ( } else if (feature.type !== REPORT_TYPE_SECRET_DETECTION) {
[ expect(wrapper.findByTestId(feature.type).text()).toMatchInterpolatedText(UPGRADE_CTA);
REPORT_TYPE_DAST, }
REPORT_TYPE_DAST_PROFILES, });
REPORT_TYPE_DEPENDENCY_SCANNING,
REPORT_TYPE_CONTAINER_SCANNING, it('should show expected help link', () => {
REPORT_TYPE_COVERAGE_FUZZING, const helpLink = findHelpLinks().at(i);
REPORT_TYPE_LICENSE_COMPLIANCE, expect(helpLink.attributes('href')).toBe(feature.helpPath);
].includes(feature.type) });
) {
expect(wrapper.findByTestId(feature.type).text()).toMatchInterpolatedText(UPGRADE_CTA);
}
}); });
}); });
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