diff options
author | Winnie Hellmann <winnie@gitlab.com> | 2019-02-20 23:36:27 +0300 |
---|---|---|
committer | Winnie Hellmann <winnie@gitlab.com> | 2019-02-21 13:02:32 +0300 |
commit | db735b66a0b19ab4f1f5048cf308bf588b64861e (patch) | |
tree | 0411f75e80019a2c9b16f3dc324927764eb9f286 /spec | |
parent | fd8749697115a6d5188ab55cb173bfe4a0246a2d (diff) |
Add snapshot test to discussion_jump_to_next_button_spec.js
Diffstat (limited to 'spec')
-rw-r--r-- | spec/frontend/notes/components/__snapshots__/discussion_jump_to_next_button_spec.js.snap | 20 | ||||
-rw-r--r-- | spec/frontend/notes/components/discussion_jump_to_next_button_spec.js | 10 |
2 files changed, 27 insertions, 3 deletions
diff --git a/spec/frontend/notes/components/__snapshots__/discussion_jump_to_next_button_spec.js.snap b/spec/frontend/notes/components/__snapshots__/discussion_jump_to_next_button_spec.js.snap new file mode 100644 index 00000000000..11d65ced180 --- /dev/null +++ b/spec/frontend/notes/components/__snapshots__/discussion_jump_to_next_button_spec.js.snap @@ -0,0 +1,20 @@ +// 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> +`; diff --git a/spec/frontend/notes/components/discussion_jump_to_next_button_spec.js b/spec/frontend/notes/components/discussion_jump_to_next_button_spec.js index 2a4df126ff9..989b0458481 100644 --- a/spec/frontend/notes/components/discussion_jump_to_next_button_spec.js +++ b/spec/frontend/notes/components/discussion_jump_to_next_button_spec.js @@ -1,11 +1,11 @@ -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'; -describe('jumpToNextDiscussionButton', () => { +describe('JumpToNextDiscussionButton', () => { let wrapper; beforeEach(() => { - wrapper = shallowMount(jumpToNextDiscussionButton, { + wrapper = shallowMount(JumpToNextDiscussionButton, { sync: false, }); }); @@ -14,6 +14,10 @@ describe('jumpToNextDiscussionButton', () => { wrapper.destroy(); }); + it('matches the snapshot', () => { + expect(wrapper.vm.$el).toMatchSnapshot(); + }); + it('emits onClick event on button click', () => { const button = wrapper.find({ ref: 'button' }); |