Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Gascou-Vaillancourt <pgascouvaillancourt@gitlab.com>2019-06-27 17:33:42 +0300
committerFilipa Lacerda <filipa@gitlab.com>2019-06-27 17:33:42 +0300
commitae9f91d18c20236f134f9333192730d8a9d42e15 (patch)
tree068d68c4a10e0b5b5c38c4a878cad2ee3a5c1583 /spec/frontend/notes
parentd56d5f98033a76119c82257ded8d4fe6a49b5a0d (diff)
Fix unresponsive reply button in discussions
Events listeners have been fixed to ensure UI interactions are properly handled in discussion notes
Diffstat (limited to 'spec/frontend/notes')
-rw-r--r--spec/frontend/notes/components/discussion_notes_spec.js38
1 files changed, 38 insertions, 0 deletions
diff --git a/spec/frontend/notes/components/discussion_notes_spec.js b/spec/frontend/notes/components/discussion_notes_spec.js
index c3204b3aaa0..394666403ee 100644
--- a/spec/frontend/notes/components/discussion_notes_spec.js
+++ b/spec/frontend/notes/components/discussion_notes_spec.js
@@ -112,6 +112,44 @@ describe('DiscussionNotes', () => {
});
});
+ describe('events', () => {
+ describe('with groupped notes and replies expanded', () => {
+ const findNoteAtIndex = index => wrapper.find(`.note:nth-of-type(${index + 1}`);
+
+ beforeEach(() => {
+ createComponent({ shouldGroupReplies: true, isExpanded: true });
+ });
+
+ it('emits deleteNote when first note emits handleDeleteNote', () => {
+ findNoteAtIndex(0).vm.$emit('handleDeleteNote');
+ expect(wrapper.emitted().deleteNote).toBeTruthy();
+ });
+
+ it('emits startReplying when first note emits startReplying', () => {
+ findNoteAtIndex(0).vm.$emit('startReplying');
+ expect(wrapper.emitted().startReplying).toBeTruthy();
+ });
+
+ it('emits deleteNote when second note emits handleDeleteNote', () => {
+ findNoteAtIndex(1).vm.$emit('handleDeleteNote');
+ expect(wrapper.emitted().deleteNote).toBeTruthy();
+ });
+ });
+
+ describe('with ungroupped notes', () => {
+ let note;
+ beforeEach(() => {
+ createComponent();
+ note = wrapper.find('.note');
+ });
+
+ it('emits deleteNote when first note emits handleDeleteNote', () => {
+ note.vm.$emit('handleDeleteNote');
+ expect(wrapper.emitted().deleteNote).toBeTruthy();
+ });
+ });
+ });
+
describe('componentData', () => {
beforeEach(() => {
createComponent();