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