Commit 5733b7a9 authored by Natalia Tepluhina's avatar Natalia Tepluhina

Merge branch '291742-fix-slow-ee-mr-widget-options-spec' into 'master'

Fix slow test `ee_mr_widget_options_spec.js`

See merge request gitlab-org/gitlab!49413
parents 91b80533 c13019f4
...@@ -25,6 +25,12 @@ import mockData, { ...@@ -25,6 +25,12 @@ import mockData, {
pipelineJobs, pipelineJobs,
} from './mock_data'; } from './mock_data';
// Force Jest to transpile and cache
// eslint-disable-next-line import/order, no-unused-vars
import _GroupedSecurityReportsApp from 'ee/vue_shared/security_reports/grouped_security_reports_app.vue';
// eslint-disable-next-line no-unused-vars
import _Deployment from '~/vue_merge_request_widget/components/deployment/deployment.vue';
const SAST_SELECTOR = '.js-sast-widget'; const SAST_SELECTOR = '.js-sast-widget';
const DAST_SELECTOR = '.js-dast-widget'; const DAST_SELECTOR = '.js-dast-widget';
const DEPENDENCY_SCANNING_SELECTOR = '.js-dependency-scanning-widget'; const DEPENDENCY_SCANNING_SELECTOR = '.js-dependency-scanning-widget';
...@@ -51,6 +57,7 @@ describe('ee merge request widget options', () => { ...@@ -51,6 +57,7 @@ describe('ee merge request widget options', () => {
delete mrWidgetOptions.extends.el; // Prevent component mounting delete mrWidgetOptions.extends.el; // Prevent component mounting
gon.features = { asyncMrWidget: true }; gon.features = { asyncMrWidget: true };
gl.mrWidgetData = { ...mockData };
Component = Vue.extend(mrWidgetOptions); Component = Vue.extend(mrWidgetOptions);
mock = new MockAdapter(axios); mock = new MockAdapter(axios);
...@@ -67,6 +74,7 @@ describe('ee merge request widget options', () => { ...@@ -67,6 +74,7 @@ describe('ee merge request widget options', () => {
// https://gitlab.com/gitlab-org/gitlab/-/issues/214032 // https://gitlab.com/gitlab-org/gitlab/-/issues/214032
return waitForPromises().then(() => { return waitForPromises().then(() => {
vm.$destroy(); vm.$destroy();
vm = null;
mock.restore(); mock.restore();
gon.features = {}; gon.features = {};
}); });
......
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