Commit a474f44a authored by Illya Klymov's avatar Illya Klymov

Merge branch 'dpisek-add-global-vue-mock-to-prevent-console-infos' into 'master'

Add jest-mock for vue to prevent console logs

See merge request gitlab-org/gitlab!56929
parents 8284bece 041df93f
import Vue from 'vue';
Vue.config.productionTip = false;
Vue.config.devtools = false;
export default Vue;
export * from 'vue';
import { shallowMount } from '@vue/test-utils'; import { shallowMount } from '@vue/test-utils';
import { config as vueConfig } from 'vue'; import Vue from 'vue';
import IssueTimeEstimate from '~/boards/components/issue_time_estimate.vue'; import IssueTimeEstimate from '~/boards/components/issue_time_estimate.vue';
describe('Issue Time Estimate component', () => { describe('Issue Time Estimate component', () => {
...@@ -34,10 +34,10 @@ describe('Issue Time Estimate component', () => { ...@@ -34,10 +34,10 @@ describe('Issue Time Estimate component', () => {
try { try {
// This will raise props validating warning by Vue, silencing it // This will raise props validating warning by Vue, silencing it
vueConfig.silent = true; Vue.config.silent = true;
await wrapper.setProps({ estimate: 'Foo <script>alert("XSS")</script>' }); await wrapper.setProps({ estimate: 'Foo <script>alert("XSS")</script>' });
} finally { } finally {
vueConfig.silent = false; Vue.config.silent = false;
} }
expect(alertSpy).not.toHaveBeenCalled(); expect(alertSpy).not.toHaveBeenCalled();
......
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