Commit db735b66 authored by Winnie Hellmann's avatar Winnie Hellmann

Add snapshot test to discussion_jump_to_next_button_spec.js

parent fd874969
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`JumpToNextDiscussionButton matches the snapshot 1`] = `
<div
class="btn-group"
role="group"
>
<button
class="btn btn-default discussion-next-btn"
data-original-title="Jump to next unresolved discussion"
title=""
>
<icon-stub
cssclasses=""
name="comment-next"
size="16"
/>
</button>
</div>
`;
import jumpToNextDiscussionButton from '~/notes/components/discussion_jump_to_next_button.vue'; import JumpToNextDiscussionButton from '~/notes/components/discussion_jump_to_next_button.vue';
import { shallowMount } from '@vue/test-utils'; import { shallowMount } from '@vue/test-utils';
describe('jumpToNextDiscussionButton', () => { describe('JumpToNextDiscussionButton', () => {
let wrapper; let wrapper;
beforeEach(() => { beforeEach(() => {
wrapper = shallowMount(jumpToNextDiscussionButton, { wrapper = shallowMount(JumpToNextDiscussionButton, {
sync: false, sync: false,
}); });
}); });
...@@ -14,6 +14,10 @@ describe('jumpToNextDiscussionButton', () => { ...@@ -14,6 +14,10 @@ describe('jumpToNextDiscussionButton', () => {
wrapper.destroy(); wrapper.destroy();
}); });
it('matches the snapshot', () => {
expect(wrapper.vm.$el).toMatchSnapshot();
});
it('emits onClick event on button click', () => { it('emits onClick event on button click', () => {
const button = wrapper.find({ ref: 'button' }); const button = wrapper.find({ ref: 'button' });
......
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