debian-mirror-gitlab/spec/frontend/notes/components/note_actions/reply_button_spec.js
2020-04-22 19:07:51 +05:30

29 lines
673 B
JavaScript

import Vuex from 'vuex';
import { createLocalVue, mount } 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,
});
});
afterEach(() => {
wrapper.destroy();
});
it('emits startReplying on click', () => {
const button = wrapper.find({ ref: 'button' });
button.trigger('click');
expect(wrapper.emitted().startReplying).toBeTruthy();
expect(wrapper.emitted().startReplying.length).toBe(1);
});
});