diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-01-30 09:08:47 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-01-30 09:08:47 +0000 |
commit | 4381702a8509383c7158a4d89a0ed187532604f2 (patch) | |
tree | c5f68f7f5791974debda374611410c189740575c /spec/frontend/work_items/components/notes/work_item_note_actions_spec.js | |
parent | a56c206075c757ef6ecd5a5a3803d5e03379d369 (diff) | |
download | gitlab-ce-4381702a8509383c7158a4d89a0ed187532604f2.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/frontend/work_items/components/notes/work_item_note_actions_spec.js')
-rw-r--r-- | spec/frontend/work_items/components/notes/work_item_note_actions_spec.js | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/spec/frontend/work_items/components/notes/work_item_note_actions_spec.js b/spec/frontend/work_items/components/notes/work_item_note_actions_spec.js new file mode 100644 index 00000000000..f3d0e86ee53 --- /dev/null +++ b/spec/frontend/work_items/components/notes/work_item_note_actions_spec.js @@ -0,0 +1,31 @@ +import { shallowMount } from '@vue/test-utils'; +import ReplyButton from '~/notes/components/note_actions/reply_button.vue'; +import WorkItemNoteActions from '~/work_items/components/notes/work_item_note_actions.vue'; + +describe('Work Item Note Actions', () => { + let wrapper; + + const findReplyButton = () => wrapper.findComponent(ReplyButton); + + const createComponent = ({ showReply = true } = {}) => { + wrapper = shallowMount(WorkItemNoteActions, { + propsData: { + showReply, + }, + }); + }; + + describe('Default', () => { + it('Should show the reply button by default', () => { + createComponent(); + expect(findReplyButton().exists()).toBe(true); + }); + }); + + describe('When the reply button needs to be hidden', () => { + it('Should show the reply button by default', () => { + createComponent({ showReply: false }); + expect(findReplyButton().exists()).toBe(false); + }); + }); +}); |