diff options
Diffstat (limited to 'spec/frontend/notes/components/note_actions/reply_button_spec.js')
-rw-r--r-- | spec/frontend/notes/components/note_actions/reply_button_spec.js | 19 |
1 files changed, 6 insertions, 13 deletions
diff --git a/spec/frontend/notes/components/note_actions/reply_button_spec.js b/spec/frontend/notes/components/note_actions/reply_button_spec.js index 720ab10b270..4993ded365d 100644 --- a/spec/frontend/notes/components/note_actions/reply_button_spec.js +++ b/spec/frontend/notes/components/note_actions/reply_button_spec.js @@ -1,29 +1,22 @@ -import Vuex from 'vuex'; -import { createLocalVue, mount } from '@vue/test-utils'; +import { GlButton } from '@gitlab/ui'; +import { shallowMount } from '@vue/test-utils'; import ReplyButton from '~/notes/components/note_actions/reply_button.vue'; -const localVue = createLocalVue(); -localVue.use(Vuex); - describe('ReplyButton', () => { let wrapper; beforeEach(() => { - wrapper = mount(localVue.extend(ReplyButton), { - localVue, - }); + wrapper = shallowMount(ReplyButton); }); afterEach(() => { wrapper.destroy(); + wrapper = null; }); it('emits startReplying on click', () => { - const button = wrapper.find({ ref: 'button' }); - - button.trigger('click'); + wrapper.find(GlButton).vm.$emit('click'); - expect(wrapper.emitted().startReplying).toBeTruthy(); - expect(wrapper.emitted().startReplying.length).toBe(1); + expect(wrapper.emitted('startReplying')).toEqual([[]]); }); }); |