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:
authorFilipa Lacerda <filipa@gitlab.com>2018-12-12 12:39:28 +0300
committerFilipa Lacerda <filipa@gitlab.com>2018-12-12 12:39:28 +0300
commitf5eddb807440b1d41244d00323f8523179f24e16 (patch)
tree2fdbc446a3db9d1e9e6601f60483c1173cafdc4a /spec/javascripts
parentd675b3e846beb12b68a6aae4596446162acb5958 (diff)
parent4e65fe2f1e21fd6a5dec97f4b2a2b009d61e3ce9 (diff)
Merge branch 'fixed-note-awards-js' into 'master'
Fixed emoji awards not being added to notes Closes #55141 See merge request gitlab-org/gitlab-ce!23720
Diffstat (limited to 'spec/javascripts')
-rw-r--r--spec/javascripts/notes/components/note_app_spec.js23
1 files changed, 23 insertions, 0 deletions
diff --git a/spec/javascripts/notes/components/note_app_spec.js b/spec/javascripts/notes/components/note_app_spec.js
index 0081f42c330..22bee049f9c 100644
--- a/spec/javascripts/notes/components/note_app_spec.js
+++ b/spec/javascripts/notes/components/note_app_spec.js
@@ -30,6 +30,8 @@ describe('note_app', () => {
jasmine.addMatchers(vueMatchers);
$('body').attr('data-page', 'projects:merge_requests:show');
+ setFixtures('<div class="js-vue-notes-event"><div id="app"></div></div>');
+
const IssueNotesApp = Vue.extend(notesApp);
store = createStore();
@@ -43,6 +45,7 @@ describe('note_app', () => {
return mountComponentWithStore(IssueNotesApp, {
props,
store,
+ el: document.getElementById('app'),
});
};
});
@@ -283,4 +286,24 @@ describe('note_app', () => {
}, 0);
});
});
+
+ describe('emoji awards', () => {
+ it('dispatches toggleAward after toggleAward event', () => {
+ const toggleAwardEvent = new CustomEvent('toggleAward', {
+ detail: {
+ awardName: 'test',
+ noteId: 1,
+ },
+ });
+
+ spyOn(vm.$store, 'dispatch');
+
+ vm.$el.parentElement.dispatchEvent(toggleAwardEvent);
+
+ expect(vm.$store.dispatch).toHaveBeenCalledWith('toggleAward', {
+ awardName: 'test',
+ noteId: 1,
+ });
+ });
+ });
});