summaryrefslogtreecommitdiff
path: root/spec/javascripts
diff options
context:
space:
mode:
authorPhil Hughes <me@iamphill.com>2018-09-13 12:52:24 +0100
committerPhil Hughes <me@iamphill.com>2018-09-13 12:52:24 +0100
commita77a26eade518b025dc52295b5af60492ff81338 (patch)
tree2135a0f2c72f2bd7a2540de525a7bffdc8b14d00 /spec/javascripts
parent8287f3477f4aaaa50f900ec06bef6e86f489a16d (diff)
downloadgitlab-ce-a77a26eade518b025dc52295b5af60492ff81338.tar.gz
Use MR widget event_hub to dispatch update event
Instead of relying on a global method, we now emit an event on the MR widget that tells it to check the status
Diffstat (limited to 'spec/javascripts')
-rw-r--r--spec/javascripts/notes/stores/actions_spec.js7
1 files changed, 3 insertions, 4 deletions
diff --git a/spec/javascripts/notes/stores/actions_spec.js b/spec/javascripts/notes/stores/actions_spec.js
index 350162d5bb6..f4643fd55ed 100644
--- a/spec/javascripts/notes/stores/actions_spec.js
+++ b/spec/javascripts/notes/stores/actions_spec.js
@@ -3,6 +3,7 @@ import _ from 'underscore';
import { headersInterceptor } from 'spec/helpers/vue_resource_helper';
import * as actions from '~/notes/stores/actions';
import createStore from '~/notes/stores';
+import mrWidgetEventHub from '~/vue_merge_request_widget/event_hub';
import testAction from '../../helpers/vuex_action_helper';
import { resetStore } from '../helpers';
import {
@@ -501,13 +502,11 @@ describe('Actions Notes Store', () => {
describe('updateMergeRequestWidget', () => {
it('calls mrWidget checkStatus', () => {
- gl.mrWidget = {
- checkStatus: jasmine.createSpy('checkStatus'),
- };
+ spyOn(mrWidgetEventHub, '$emit');
actions.updateMergeRequestWidget();
- expect(gl.mrWidget.checkStatus).toHaveBeenCalled();
+ expect(mrWidgetEventHub.$emit).toHaveBeenCalledWith('mr.discussion.updated');
});
});
});