summaryrefslogtreecommitdiff
path: root/spec/frontend/notes/components/discussion_jump_to_next_button_spec.js
blob: 989b0458481a9c40c81429e044d16b390a1aed0a (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 JumpToNextDiscussionButton from '~/notes/components/discussion_jump_to_next_button.vue';
import { shallowMount } from '@vue/test-utils';

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

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

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

  it('matches the snapshot', () => {
    expect(wrapper.vm.$el).toMatchSnapshot();
  });

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

    button.trigger('click');

    expect(wrapper.emitted()).toEqual({
      onClick: [[]],
    });
  });
});