Commit 041df93f authored by Dave Pisek's avatar Dave Pisek

Fix config.silent set

parent 512e3653
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