summaryrefslogtreecommitdiff
path: root/spec/javascripts/notes/components/note_actions/reply_button_spec.js
diff options
context:
space:
mode:
Diffstat (limited to 'spec/javascripts/notes/components/note_actions/reply_button_spec.js')
-rw-r--r--spec/javascripts/notes/components/note_actions/reply_button_spec.js22
1 files changed, 4 insertions, 18 deletions
diff --git a/spec/javascripts/notes/components/note_actions/reply_button_spec.js b/spec/javascripts/notes/components/note_actions/reply_button_spec.js
index 11e1664a3f4..11fb89808d9 100644
--- a/spec/javascripts/notes/components/note_actions/reply_button_spec.js
+++ b/spec/javascripts/notes/components/note_actions/reply_button_spec.js
@@ -3,27 +3,14 @@ import { createLocalVue, mount } from '@vue/test-utils';
import ReplyButton from '~/notes/components/note_actions/reply_button.vue';
describe('ReplyButton', () => {
- const noteId = 'dummy-note-id';
-
let wrapper;
- let convertToDiscussion;
beforeEach(() => {
const localVue = createLocalVue();
- convertToDiscussion = jasmine.createSpy('convertToDiscussion');
localVue.use(Vuex);
- const store = new Vuex.Store({
- actions: {
- convertToDiscussion,
- },
- });
wrapper = mount(ReplyButton, {
- propsData: {
- noteId,
- },
- store,
sync: false,
localVue,
});
@@ -33,14 +20,13 @@ describe('ReplyButton', () => {
wrapper.destroy();
});
- it('dispatches convertToDiscussion with note ID on click', () => {
+ it('emits startReplying on click', () => {
const button = wrapper.find({ ref: 'button' });
button.trigger('click');
- expect(convertToDiscussion).toHaveBeenCalledTimes(1);
- const [, payload] = convertToDiscussion.calls.argsFor(0);
-
- expect(payload).toBe(noteId);
+ expect(wrapper.emitted()).toEqual({
+ startReplying: [[]],
+ });
});
});