diff options
author | Phil Hughes <me@iamphill.com> | 2019-06-27 07:42:19 +0000 |
---|---|---|
committer | Phil Hughes <me@iamphill.com> | 2019-06-27 07:42:19 +0000 |
commit | edcd28ca44649b5b3e0729a95a4d6b684e1ff7cb (patch) | |
tree | d898d698ccd7ee6e0518df3516fa5ba2c09e736c | |
parent | ec5137f65a558d2a8e3884729ee46f9b91f627a9 (diff) | |
parent | 0e701c1304c8ebe1b7f382713c4f7c022560019c (diff) | |
download | gitlab-ce-edcd28ca44649b5b3e0729a95a4d6b684e1ff7cb.tar.gz |
Merge branch '54595-incorrect-reaction-emoji-placement-in-discussion' into 'master'
Fix incorrect reaction placement in commit diff discussion
Closes #54595
See merge request gitlab-org/gitlab-ce!29445
3 files changed, 22 insertions, 1 deletions
diff --git a/app/views/projects/notes/_actions.html.haml b/app/views/projects/notes/_actions.html.haml index 044adb75bea..407de590efb 100644 --- a/app/views/projects/notes/_actions.html.haml +++ b/app/views/projects/notes/_actions.html.haml @@ -39,7 +39,7 @@ - if can?(current_user, :award_emoji, note) - if note.emoji_awardable? .note-actions-item - = button_tag title: 'Add reaction', class: "note-action-button note-emoji-button js-add-award js-note-emoji} has-tooltip btn btn-transparent", data: { position: 'right', container: 'body' } do + = button_tag title: 'Add reaction', class: "note-action-button note-emoji-button js-add-award js-note-emoji has-tooltip btn btn-transparent", data: { position: 'right', container: 'body' } do = icon('spinner spin') %span{ class: 'link-highlight award-control-icon-neutral' }= sprite_icon('slight-smile') %span{ class: 'link-highlight award-control-icon-positive' }= sprite_icon('smiley') diff --git a/changelogs/unreleased/54595-incorrect-reaction-emoji-placement-in-discussion.yml b/changelogs/unreleased/54595-incorrect-reaction-emoji-placement-in-discussion.yml new file mode 100644 index 00000000000..639eefb50cb --- /dev/null +++ b/changelogs/unreleased/54595-incorrect-reaction-emoji-placement-in-discussion.yml @@ -0,0 +1,5 @@ +--- +title: Fix incorrect emoji placement in commit diff discussion +merge_request: 29445 +author: +type: fixed diff --git a/spec/features/discussion_comments/commit_spec.rb b/spec/features/discussion_comments/commit_spec.rb index 7a3b1d7ed47..ea720cee74e 100644 --- a/spec/features/discussion_comments/commit_spec.rb +++ b/spec/features/discussion_comments/commit_spec.rb @@ -6,6 +6,8 @@ describe 'Discussion Comments Commit', :js do let(:user) { create(:user) } let(:project) { create(:project, :repository) } let(:merge_request) { create(:merge_request, source_project: project) } + let!(:commit_discussion_note1) { create(:discussion_note_on_commit, project: project) } + let!(:commit_discussion_note2) { create(:discussion_note_on_commit, in_reply_to: commit_discussion_note1) } before do project.add_maintainer(user) @@ -15,4 +17,18 @@ describe 'Discussion Comments Commit', :js do end it_behaves_like 'discussion comments', 'commit' + + it 'has class .js-note-emoji' do + expect(page).to have_css('.js-note-emoji') + end + + it 'adds award to the correct note' do + find("#note_#{commit_discussion_note2.id} .js-note-emoji").click + first('.emoji-menu .js-emoji-btn').click + + wait_for_requests + + expect(find("#note_#{commit_discussion_note1.id}")).not_to have_css('.js-awards-block') + expect(find("#note_#{commit_discussion_note2.id}")).to have_css('.js-awards-block') + end end |