Commit 64aafe2f authored by Coung Ngo's avatar Coung Ngo

Remove ref from ReplyButton component

Clean up some code as a follow-up from a previous MR

https://gitlab.com/gitlab-org/gitlab/-/issues/321379
parent 6549a87a
......@@ -18,7 +18,6 @@ export default {
<template>
<gl-button
ref="button"
v-gl-tooltip
data-track-event="click_button"
data-track-label="reply_comment_button"
......
import { createLocalVue, mount } from '@vue/test-utils';
import Vuex from 'vuex';
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([[]]);
});
});
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