summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWinnie Hellmann <winnie@gitlab.com>2018-09-25 15:49:05 +0200
committerWinnie Hellmann <winnie@gitlab.com>2018-09-25 15:49:05 +0200
commitf183dba7c7744d62d70bded89cda4db00a61ca3f (patch)
treec41adcf9e1910214abe2e18aa297e961428d3efa
parentcb0f024cd4c4aa51c7824e4e1a6c4d0f307afad1 (diff)
downloadgitlab-ce-f183dba7c7744d62d70bded89cda4db00a61ca3f.tar.gz
Cleanup polling of merge request widget in tests
-rw-r--r--app/assets/javascripts/vue_merge_request_widget/mr_widget_options.vue2
-rw-r--r--spec/javascripts/vue_mr_widget/mr_widget_options_spec.js4
2 files changed, 6 insertions, 0 deletions
diff --git a/app/assets/javascripts/vue_merge_request_widget/mr_widget_options.vue b/app/assets/javascripts/vue_merge_request_widget/mr_widget_options.vue
index b5eaaf054e7..0e445a29de4 100644
--- a/app/assets/javascripts/vue_merge_request_widget/mr_widget_options.vue
+++ b/app/assets/javascripts/vue_merge_request_widget/mr_widget_options.vue
@@ -114,6 +114,8 @@ export default {
},
beforeDestroy() {
eventHub.$off('mr.discussion.updated', this.checkStatus);
+ this.pollingInterval.destroy();
+ this.deploymentsInterval.destroy();
},
methods: {
createService(store) {
diff --git a/spec/javascripts/vue_mr_widget/mr_widget_options_spec.js b/spec/javascripts/vue_mr_widget/mr_widget_options_spec.js
index 6342ea00436..6ac7138743b 100644
--- a/spec/javascripts/vue_mr_widget/mr_widget_options_spec.js
+++ b/spec/javascripts/vue_mr_widget/mr_widget_options_spec.js
@@ -27,6 +27,10 @@ describe('mrWidgetOptions', () => {
});
});
+ afterEach(() => {
+ vm.$destroy();
+ });
+
describe('data', () => {
it('should instantiate Store and Service', () => {
expect(vm.mr).toBeDefined();