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

discussion_jump_to_next_button_spec.js « components « notes « frontend « spec - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: c41b29fa78847ee8396df90354d9abd6e72c15f5 (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
31
32
33
import jumpToNextDiscussionButton from '~/notes/components/discussion_jump_to_next_button.vue';
import { shallowMount, createLocalVue } from '@vue/test-utils';

const localVue = createLocalVue();

describe('jumpToNextDiscussionButton', () => {
  let wrapper;

  beforeEach(() => {
    wrapper = shallowMount(jumpToNextDiscussionButton, {
      localVue,
      sync: false,
    });
  });

  afterEach(() => {
    wrapper.destroy();
  });

  it('emits onClick event on button click', done => {
    const button = wrapper.find({ ref: 'button' });

    button.trigger('click');

    localVue.nextTick(() => {
      expect(wrapper.emitted()).toEqual({
        onClick: [[]],
      });

      done();
    });
  });
});