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 {
<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