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-08-07 03:09:01 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2021-08-07 03:09:01 +0300
commit4e4519f1f8ee22cca599a8d9b7f7dbc7a9764052 (patch)
treef35947207d63ca022236b7637825ed17afb8c8e1 /spec/frontend/security_configuration
parent5de148b2f4b20e1e900cd085580ab0d7fa5f092b (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/frontend/security_configuration')
-rw-r--r--spec/frontend/security_configuration/app_spec.js27
-rw-r--r--spec/frontend/security_configuration/components/app_spec.js (renamed from spec/frontend/security_configuration/components/redesigned_app_spec.js)10
-rw-r--r--spec/frontend/security_configuration/configuration_table_spec.js52
-rw-r--r--spec/frontend/security_configuration/upgrade_spec.js30
4 files changed, 4 insertions, 115 deletions
diff --git a/spec/frontend/security_configuration/app_spec.js b/spec/frontend/security_configuration/app_spec.js
deleted file mode 100644
index 11d481fb210..00000000000
--- a/spec/frontend/security_configuration/app_spec.js
+++ /dev/null
@@ -1,27 +0,0 @@
-import { shallowMount } from '@vue/test-utils';
-import App from '~/security_configuration/components/app.vue';
-import ConfigurationTable from '~/security_configuration/components/configuration_table.vue';
-
-describe('App Component', () => {
- let wrapper;
-
- const createComponent = () => {
- wrapper = shallowMount(App, {});
- };
- const findConfigurationTable = () => wrapper.findComponent(ConfigurationTable);
-
- afterEach(() => {
- wrapper.destroy();
- });
-
- it('renders correct primary & Secondary Heading', () => {
- createComponent();
- expect(wrapper.text()).toContain('Security Configuration');
- expect(wrapper.text()).toContain('Testing & Compliance');
- });
-
- it('renders ConfigurationTable Component', () => {
- createComponent();
- expect(findConfigurationTable().exists()).toBe(true);
- });
-});
diff --git a/spec/frontend/security_configuration/components/redesigned_app_spec.js b/spec/frontend/security_configuration/components/app_spec.js
index 92e0443552c..f27f45f2b26 100644
--- a/spec/frontend/security_configuration/components/redesigned_app_spec.js
+++ b/spec/frontend/security_configuration/components/app_spec.js
@@ -4,6 +4,7 @@ import { useLocalStorageSpy } from 'helpers/local_storage_helper';
import { makeMockUserCalloutDismisser } from 'helpers/mock_user_callout_dismisser';
import stubChildren from 'helpers/stub_children';
import { extendedWrapper } from 'helpers/vue_test_utils_helper';
+import SecurityConfigurationApp, { i18n } from '~/security_configuration/components/app.vue';
import AutoDevopsAlert from '~/security_configuration/components/auto_dev_ops_alert.vue';
import AutoDevopsEnabledAlert from '~/security_configuration/components/auto_dev_ops_enabled_alert.vue';
import {
@@ -19,9 +20,6 @@ import {
} from '~/security_configuration/components/constants';
import FeatureCard from '~/security_configuration/components/feature_card.vue';
-import RedesignedSecurityConfigurationApp, {
- i18n,
-} from '~/security_configuration/components/redesigned_app.vue';
import UpgradeBanner from '~/security_configuration/components/upgrade_banner.vue';
import {
REPORT_TYPE_LICENSE_COMPLIANCE,
@@ -36,7 +34,7 @@ const projectPath = 'namespace/project';
useLocalStorageSpy();
-describe('redesigned App component', () => {
+describe('App component', () => {
let wrapper;
let userCalloutDismissSpy;
@@ -44,7 +42,7 @@ describe('redesigned App component', () => {
userCalloutDismissSpy = jest.fn();
wrapper = extendedWrapper(
- mount(RedesignedSecurityConfigurationApp, {
+ mount(SecurityConfigurationApp, {
propsData,
provide: {
upgradePath,
@@ -53,7 +51,7 @@ describe('redesigned App component', () => {
projectPath,
},
stubs: {
- ...stubChildren(RedesignedSecurityConfigurationApp),
+ ...stubChildren(SecurityConfigurationApp),
GlLink: false,
GlSprintf: false,
LocalStorageSync: false,
diff --git a/spec/frontend/security_configuration/configuration_table_spec.js b/spec/frontend/security_configuration/configuration_table_spec.js
deleted file mode 100644
index fbd72265c4b..00000000000
--- a/spec/frontend/security_configuration/configuration_table_spec.js
+++ /dev/null
@@ -1,52 +0,0 @@
-import { mount } from '@vue/test-utils';
-import { extendedWrapper } from 'helpers/vue_test_utils_helper';
-import ConfigurationTable from '~/security_configuration/components/configuration_table.vue';
-import { scanners, UPGRADE_CTA } from '~/security_configuration/components/constants';
-
-import {
- REPORT_TYPE_SAST,
- REPORT_TYPE_SECRET_DETECTION,
-} from '~/vue_shared/security_reports/constants';
-
-describe('Configuration Table Component', () => {
- let wrapper;
-
- const createComponent = () => {
- wrapper = extendedWrapper(
- mount(ConfigurationTable, {
- provide: {
- projectPath: 'testProjectPath',
- },
- }),
- );
- };
-
- const findHelpLinks = () => wrapper.findAll('[data-testid="help-link"]');
-
- afterEach(() => {
- wrapper.destroy();
- });
-
- beforeEach(() => {
- createComponent();
- });
-
- describe.each(scanners.map((scanner, i) => [scanner, i]))('given scanner %s', (scanner, i) => {
- it('should match strings', () => {
- expect(wrapper.text()).toContain(scanner.name);
- expect(wrapper.text()).toContain(scanner.description);
- if (scanner.type === REPORT_TYPE_SAST) {
- expect(wrapper.findByTestId(scanner.type).text()).toBe('Configure via Merge Request');
- } else if (scanner.type === REPORT_TYPE_SECRET_DETECTION) {
- expect(wrapper.findByTestId(scanner.type).exists()).toBe(false);
- } else {
- expect(wrapper.findByTestId(scanner.type).text()).toMatchInterpolatedText(UPGRADE_CTA);
- }
- });
-
- it('should show expected help link', () => {
- const helpLink = findHelpLinks().at(i);
- expect(helpLink.attributes('href')).toBe(scanner.helpPath);
- });
- });
-});
diff --git a/spec/frontend/security_configuration/upgrade_spec.js b/spec/frontend/security_configuration/upgrade_spec.js
deleted file mode 100644
index 20bb38aa469..00000000000
--- a/spec/frontend/security_configuration/upgrade_spec.js
+++ /dev/null
@@ -1,30 +0,0 @@
-import { mount } from '@vue/test-utils';
-import { UPGRADE_CTA } from '~/security_configuration/components/constants';
-import Upgrade from '~/security_configuration/components/upgrade.vue';
-
-const TEST_URL = 'http://www.example.test';
-let wrapper;
-const createComponent = (componentData = {}) => {
- wrapper = mount(Upgrade, componentData);
-};
-
-afterEach(() => {
- wrapper.destroy();
-});
-
-describe('Upgrade component', () => {
- beforeEach(() => {
- createComponent({ provide: { upgradePath: TEST_URL } });
- });
-
- it('renders correct text in link', () => {
- expect(wrapper.text()).toMatchInterpolatedText(UPGRADE_CTA);
- });
-
- it('renders link with correct default attributes', () => {
- expect(wrapper.find('a').attributes()).toMatchObject({
- href: TEST_URL,
- target: '_blank',
- });
- });
-});