Commit e1d21036 authored by Natalia Tepluhina's avatar Natalia Tepluhina

Merge branch 'fix-design-paste' into 'master'

Remove paste event listener on destroy

See merge request gitlab-org/gitlab!69453
parents 81c42be4 966a4c28
......@@ -140,6 +140,9 @@ export default {
this.$el.scrollIntoView();
}
},
beforeDestroy() {
document.removeEventListener('paste', this.onDesignPaste);
},
methods: {
resetFilesToBeSaved() {
this.filesToBeSaved = [];
......
......@@ -630,6 +630,16 @@ describe('Design management index page', () => {
expect(mockMutate).not.toHaveBeenCalled();
});
it('does not upload designs if designs wrapper is destroyed', () => {
findDesignsWrapper().trigger('mouseenter');
wrapper.destroy();
document.dispatchEvent(event);
expect(mockMutate).not.toHaveBeenCalled();
});
describe('when designs wrapper is hovered', () => {
let realDateNow;
const today = () => new Date('2020-12-25');
......
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