Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2021-02-19 18:10:30 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2021-02-19 18:10:30 +0300
commitd3f395c87cbab4c646bbb7db52caebec4c09ebb8 (patch)
tree54d9390199f6531e227f05b7fa85db0cd3276c12 /spec/frontend/security_configuration
parent1fdc1d34e8e3cab28cd010a2b352974da9847e8e (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/frontend/security_configuration')
-rw-r--r--spec/frontend/security_configuration/configuration_table_spec.js42
1 files changed, 18 insertions, 24 deletions
diff --git a/spec/frontend/security_configuration/configuration_table_spec.js b/spec/frontend/security_configuration/configuration_table_spec.js
index 7f850ed517e..a9d9a0dbf1a 100644
--- a/spec/frontend/security_configuration/configuration_table_spec.js
+++ b/spec/frontend/security_configuration/configuration_table_spec.js
@@ -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);
+ });
});
});