Commit a28c77f2 authored by Winnie Hellmann's avatar Winnie Hellmann Committed by Kushal Pandya

Throw error for multiple RecaptchaModal instances

parent 976f0dfa
......@@ -30,9 +30,16 @@ export default {
},
mounted() {
if (window.recaptchaDialogCallback) {
throw new Error('recaptchaDialogCallback is already defined!');
}
window.recaptchaDialogCallback = this.submit.bind(this);
},
beforeDestroy() {
window.recaptchaDialogCallback = null;
},
methods: {
appendRecaptchaScript() {
this.removeRecaptchaScript();
......
import $ from 'jquery';
import Vue from 'vue';
import '~/behaviors/markdown/render_gfm';
import Description from '~/issue_show/components/description.vue';
import mountComponent from 'spec/helpers/vue_mount_component_helper';
......@@ -91,6 +92,7 @@ describe('Description component', () => {
let TaskList;
beforeEach(() => {
vm.$destroy();
vm = mountComponent(
DescriptionComponent,
Object.assign({}, props, {
......
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