diff options
| author | Phil Hughes <me@iamphill.com> | 2019-01-28 17:33:20 +0000 |
|---|---|---|
| committer | Phil Hughes <me@iamphill.com> | 2019-01-28 17:33:20 +0000 |
| commit | 958a819fce709419c0be76cec8a20c8e8417ab84 (patch) | |
| tree | 3495af91b52dc8ff300d42d73b449b4f7e53af60 /spec/javascripts/notes | |
| parent | a24551964180614bb9b19417763996043edba25f (diff) | |
| parent | 3af7723fcde7d32986ae4a9e104a893cf0167745 (diff) | |
| download | gitlab-ce-958a819fce709419c0be76cec8a20c8e8417ab84.tar.gz | |
Merge branch 'refactor/56369-extract-jump-to-next-discussion-button' into 'master'
Refactor/56369 extract jump to next discussion button
Closes #56369
See merge request gitlab-org/gitlab-ce!24506
Diffstat (limited to 'spec/javascripts/notes')
| -rw-r--r-- | spec/javascripts/notes/components/discussion_jump_to_next_button_spec.js | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/spec/javascripts/notes/components/discussion_jump_to_next_button_spec.js b/spec/javascripts/notes/components/discussion_jump_to_next_button_spec.js new file mode 100644 index 00000000000..c41b29fa788 --- /dev/null +++ b/spec/javascripts/notes/components/discussion_jump_to_next_button_spec.js @@ -0,0 +1,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(); + }); + }); +}); |
