summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrandon Labuschagne <blabuschagne@gitlab.com>2018-12-31 13:58:20 +0000
committerFatih Acet <acetfatih@gmail.com>2018-12-31 13:58:20 +0000
commit78029952cc69dfa4cf7c090262c319efdcd4f230 (patch)
treeb3375a8ac4e37bc3f06c6440c20f52245393df8b
parentca14b70d5201852751d79d6a0827b81689fff5be (diff)
downloadgitlab-ce-78029952cc69dfa4cf7c090262c319efdcd4f230.tar.gz
Resolve "Status emoji should not update awards section on issue page"
-rw-r--r--app/assets/javascripts/set_status_modal/emoji_menu_in_modal.js3
-rw-r--r--changelogs/unreleased/52888-status-emoji-should-not-be-added-to-awards-section-on-issue-page-2.yml5
-rw-r--r--spec/features/profiles/user_edit_profile_spec.rb14
3 files changed, 20 insertions, 2 deletions
diff --git a/app/assets/javascripts/set_status_modal/emoji_menu_in_modal.js b/app/assets/javascripts/set_status_modal/emoji_menu_in_modal.js
index 14a89ef9293..3a8631a196f 100644
--- a/app/assets/javascripts/set_status_modal/emoji_menu_in_modal.js
+++ b/app/assets/javascripts/set_status_modal/emoji_menu_in_modal.js
@@ -12,9 +12,8 @@ class EmojiMenuInModal extends AwardsHandler {
this.bindEvents();
}
- postEmoji($emojiButton, awardUrl, selectedEmoji, callback) {
+ postEmoji($emojiButton, awardUrl, selectedEmoji) {
this.selectEmojiCallback(selectedEmoji, this.emoji.glEmojiTag(selectedEmoji));
- callback();
}
}
diff --git a/changelogs/unreleased/52888-status-emoji-should-not-be-added-to-awards-section-on-issue-page-2.yml b/changelogs/unreleased/52888-status-emoji-should-not-be-added-to-awards-section-on-issue-page-2.yml
new file mode 100644
index 00000000000..501940d6da3
--- /dev/null
+++ b/changelogs/unreleased/52888-status-emoji-should-not-be-added-to-awards-section-on-issue-page-2.yml
@@ -0,0 +1,5 @@
+---
+title: Prevent awards emoji being updated when updating status
+merge_request: 23470
+author:
+type: fixed
diff --git a/spec/features/profiles/user_edit_profile_spec.rb b/spec/features/profiles/user_edit_profile_spec.rb
index 5e0434c1c2c..f45bcabd196 100644
--- a/spec/features/profiles/user_edit_profile_spec.rb
+++ b/spec/features/profiles/user_edit_profile_spec.rb
@@ -147,6 +147,9 @@ describe 'User edit profile' do
end
context 'user menu' do
+ let(:issue) { create(:issue, project: project)}
+ let(:project) { create(:project) }
+
def open_user_status_modal
find('.header-user-dropdown-toggle').click
@@ -205,6 +208,17 @@ describe 'User edit profile' do
end
end
+ it 'does not update the awards panel emoji' do
+ project.add_maintainer(user)
+ visit(project_issue_path(project, issue))
+
+ emoji = 'biohazard'
+ open_user_status_modal
+ select_emoji(emoji, true)
+
+ expect(page.all('.award-control .js-counter')).to all(have_content('0'))
+ end
+
it 'adds message to user status' do
message = 'I have something to say'
open_user_status_modal