summaryrefslogtreecommitdiff
path: root/spec/frontend/work_items/components/notes/work_item_note_actions_spec.js
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2023-04-25 12:18:56 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2023-04-25 12:18:56 +0000
commitd2d913b606702ecefa01f03362602fde256e3f75 (patch)
tree07643306ee63f789188a9133823aac3c92c94dfb /spec/frontend/work_items/components/notes/work_item_note_actions_spec.js
parentaf69e63b6655a450849a8fa2640ae6ce5a8db681 (diff)
downloadgitlab-ce-d2d913b606702ecefa01f03362602fde256e3f75.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.js29
1 files changed, 29 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
index b406c9d843a..99bf391e261 100644
--- 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
@@ -22,6 +22,7 @@ describe('Work Item Note Actions', () => {
const findDeleteNoteButton = () => wrapper.find('[data-testid="delete-note-action"]');
const findCopyLinkButton = () => wrapper.find('[data-testid="copy-link-action"]');
const findAssignUnassignButton = () => wrapper.find('[data-testid="assign-note-action"]');
+ const findReportAbuseToAdminButton = () => wrapper.find('[data-testid="abuse-note-action"]');
const addEmojiMutationResolver = jest.fn().mockResolvedValue({
data: {
@@ -39,6 +40,7 @@ describe('Work Item Note Actions', () => {
showEdit = true,
showAwardEmoji = true,
showAssignUnassign = false,
+ canReportAbuse = false,
} = {}) => {
wrapper = shallowMount(WorkItemNoteActions, {
propsData: {
@@ -47,6 +49,7 @@ describe('Work Item Note Actions', () => {
noteId,
showAwardEmoji,
showAssignUnassign,
+ canReportAbuse,
},
provide: {
glFeatures: {
@@ -195,4 +198,30 @@ describe('Work Item Note Actions', () => {
expect(wrapper.emitted('assignUser')).toEqual([[]]);
});
});
+
+ describe('report abuse to admin', () => {
+ it('should not report abuse to admin by default', () => {
+ createComponent();
+
+ expect(findReportAbuseToAdminButton().exists()).toBe(false);
+ });
+
+ it('should display assign/unassign when the props is true', () => {
+ createComponent({
+ canReportAbuse: true,
+ });
+
+ expect(findReportAbuseToAdminButton().exists()).toBe(true);
+ });
+
+ it('should emit `reportAbuse` event when report abuse action is clicked', () => {
+ createComponent({
+ canReportAbuse: true,
+ });
+
+ findReportAbuseToAdminButton().vm.$emit('click');
+
+ expect(wrapper.emitted('reportAbuse')).toEqual([[]]);
+ });
+ });
});