diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-03-15 18:11:11 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-03-15 18:11:11 +0000 |
commit | f6b58d14904a1413a5442d13f361671e59ab3ded (patch) | |
tree | 5120b75e5d2bfa1773f9c5e431521afef652a8c4 /spec/frontend/work_items/components | |
parent | ce97c898865e06644ae9c04d5c3666775b9998cb (diff) | |
download | gitlab-ce-f6b58d14904a1413a5442d13f361671e59ab3ded.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/frontend/work_items/components')
4 files changed, 7 insertions, 26 deletions
diff --git a/spec/frontend/work_items/components/notes/__snapshots__/work_item_note_replying_spec.js.snap b/spec/frontend/work_items/components/notes/__snapshots__/work_item_note_replying_spec.js.snap index 5901642b8a1..1c01451f047 100644 --- a/spec/frontend/work_items/components/notes/__snapshots__/work_item_note_replying_spec.js.snap +++ b/spec/frontend/work_items/components/notes/__snapshots__/work_item_note_replying_spec.js.snap @@ -1,3 +1,3 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`Work Item Note Replying should have the note body and header 1`] = `"<note-header-stub author=\\"[object Object]\\" actiontext=\\"\\" noteabletype=\\"\\" expanded=\\"true\\" showspinner=\\"true\\"></note-header-stub>"`; +exports[`Work Item Note Replying should have the note body and header 1`] = `"<note-header-stub author=\\"[object Object]\\" actiontext=\\"\\" noteabletype=\\"\\" expanded=\\"true\\" showspinner=\\"true\\" noteurl=\\"\\"></note-header-stub>"`; diff --git a/spec/frontend/work_items/components/notes/work_item_discussion_spec.js b/spec/frontend/work_items/components/notes/work_item_discussion_spec.js index 673d4053380..6b95da0910b 100644 --- a/spec/frontend/work_items/components/notes/work_item_discussion_spec.js +++ b/spec/frontend/work_items/components/notes/work_item_discussion_spec.js @@ -1,7 +1,5 @@ -import { GlAvatarLink, GlAvatar } from '@gitlab/ui'; import { shallowMount } from '@vue/test-utils'; import { nextTick } from 'vue'; -import TimelineEntryItem from '~/vue_shared/components/notes/timeline_entry_item.vue'; import ToggleRepliesWidget from '~/notes/components/toggle_replies_widget.vue'; import WorkItemDiscussion from '~/work_items/components/notes/work_item_discussion.vue'; import WorkItemNote from '~/work_items/components/notes/work_item_note.vue'; @@ -21,9 +19,6 @@ describe('Work Item Discussion', () => { let wrapper; const mockWorkItemId = 'gid://gitlab/WorkItem/625'; - const findTimelineEntryItem = () => wrapper.findComponent(TimelineEntryItem); - const findAvatarLink = () => wrapper.findComponent(GlAvatarLink); - const findAvatar = () => wrapper.findComponent(GlAvatar); const findToggleRepliesWidget = () => wrapper.findComponent(ToggleRepliesWidget); const findAllThreads = () => wrapper.findAllComponents(WorkItemNote); const findThreadAtIndex = (index) => findAllThreads().at(index); @@ -55,19 +50,6 @@ describe('Work Item Discussion', () => { createComponent(); }); - it('Should be wrapped inside the timeline entry item', () => { - expect(findTimelineEntryItem().exists()).toBe(true); - }); - - it('should have the author avatar of the work item note', () => { - expect(findAvatarLink().exists()).toBe(true); - expect(findAvatarLink().attributes('href')).toBe(mockWorkItemCommentNote.author.webUrl); - - expect(findAvatar().exists()).toBe(true); - expect(findAvatar().props('src')).toBe(mockWorkItemCommentNote.author.avatarUrl); - expect(findAvatar().props('entityName')).toBe(mockWorkItemCommentNote.author.username); - }); - it('should not show the the toggle replies widget wrapper when no replies', () => { expect(findToggleRepliesWidget().exists()).toBe(false); }); diff --git a/spec/frontend/work_items/components/notes/work_item_note_spec.js b/spec/frontend/work_items/components/notes/work_item_note_spec.js index 9b87419cee7..8e574dc1a81 100644 --- a/spec/frontend/work_items/components/notes/work_item_note_spec.js +++ b/spec/frontend/work_items/components/notes/work_item_note_spec.js @@ -198,10 +198,6 @@ describe('Work Item Note', () => { expect(findNoteActions().exists()).toBe(true); }); - it('should not have the Avatar link for main thread inside the timeline-entry', () => { - expect(findAuthorAvatarLink().exists()).toBe(false); - }); - it('should have the reply button props', () => { expect(findNoteActions().props('showReply')).toBe(true); }); @@ -228,7 +224,7 @@ describe('Work Item Note', () => { }); }); - it('should display a dropdown if user has a permission to delete a note', () => { + it('should display the `Delete comment` dropdown item if user has a permission to delete a note', () => { createComponent({ note: { ...mockWorkItemCommentNote, @@ -237,12 +233,14 @@ describe('Work Item Note', () => { }); expect(findDropdown().exists()).toBe(true); + expect(findDeleteNoteButton().exists()).toBe(true); }); - it('should not display a dropdown if user has no permission to delete a note', () => { + it('should not display the `Delete comment` dropdown item if user has no permission to delete a note', () => { createComponent(); - expect(findDropdown().exists()).toBe(false); + expect(findDropdown().exists()).toBe(true); + expect(findDeleteNoteButton().exists()).toBe(false); }); it('should emit `deleteNote` event when delete note action is clicked', () => { diff --git a/spec/frontend/work_items/components/work_item_detail_modal_spec.js b/spec/frontend/work_items/components/work_item_detail_modal_spec.js index 1bdf5d1c840..4f7ae4059ee 100644 --- a/spec/frontend/work_items/components/work_item_detail_modal_spec.js +++ b/spec/frontend/work_items/components/work_item_detail_modal_spec.js @@ -90,6 +90,7 @@ describe('WorkItemDetailModal component', () => { workItemId: defaultPropsData.workItemId, workItemParentId: defaultPropsData.issueGid, workItemIid: null, + modal: null, }); }); |