Welcome to mirror list, hosted at ThFree Co, Russian Federation.

reply_button_spec.js « note_actions « components « notes « javascripts « spec - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: aa39ab15833e3fd481ffb16f7efdb3e0c408fdbe (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
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), {
      sync: false,
      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);
  });
});