Commit 899aaa53 authored by Jacques Erasmus's avatar Jacques Erasmus

Merge branch '321379-follow-up-from-align-note-actions-icons' into 'master'

Remove `ref` from `ReplyButton` component

See merge request gitlab-org/gitlab!54095
parents 6391a97b 64aafe2f
...@@ -18,7 +18,6 @@ export default { ...@@ -18,7 +18,6 @@ export default {
<template> <template>
<gl-button <gl-button
ref="button"
v-gl-tooltip v-gl-tooltip
data-track-event="click_button" data-track-event="click_button"
data-track-label="reply_comment_button" data-track-label="reply_comment_button"
......
import { createLocalVue, mount } from '@vue/test-utils'; import { GlButton } from '@gitlab/ui';
import Vuex from 'vuex'; import { shallowMount } from '@vue/test-utils';
import ReplyButton from '~/notes/components/note_actions/reply_button.vue'; import ReplyButton from '~/notes/components/note_actions/reply_button.vue';
const localVue = createLocalVue();
localVue.use(Vuex);
describe('ReplyButton', () => { describe('ReplyButton', () => {
let wrapper; let wrapper;
beforeEach(() => { beforeEach(() => {
wrapper = mount(localVue.extend(ReplyButton), { wrapper = shallowMount(ReplyButton);
localVue,
});
}); });
afterEach(() => { afterEach(() => {
wrapper.destroy(); wrapper.destroy();
wrapper = null;
}); });
it('emits startReplying on click', () => { it('emits startReplying on click', () => {
const button = wrapper.find({ ref: 'button' }); wrapper.find(GlButton).vm.$emit('click');
button.trigger('click');
expect(wrapper.emitted().startReplying).toBeTruthy(); expect(wrapper.emitted('startReplying')).toEqual([[]]);
expect(wrapper.emitted().startReplying.length).toBe(1);
}); });
}); });
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