mirror of
https://github.com/discourse/discourse.git
synced 2025-06-12 09:13:48 +08:00

Adds a one-click chat reactions setting to the chat preferences page where members can determine what one-click reactions are shown in chat. - Frequent: This will be the default setting. (Automatically set based on most used chat reactions) - Custom: Members can choose up to three reactions they want to see in their one-click chat/DM reactions menu. Defaults are `❤️`, `👍` , and `😄`.  This pull request is essentially the work of @dsims in https://github.com/discourse/discourse/pull/31761 --------- Co-authored-by: dsims <1041068+dsims@users.noreply.github.com>
34 lines
1016 B
Ruby
34 lines
1016 B
Ruby
# frozen_string_literal: true
|
|
|
|
RSpec.describe UserSerializer do
|
|
fab!(:user)
|
|
|
|
let(:serializer) { described_class.new(user, scope: Guardian.new(user), root: false) }
|
|
|
|
describe "#chat_separate_sidebar_mode" do
|
|
it "is present" do
|
|
expect(serializer.as_json[:user_option][:chat_separate_sidebar_mode]).to eq("default")
|
|
end
|
|
end
|
|
|
|
describe "#chat_quick_reaction_type" do
|
|
it "is present with default enum string" do
|
|
expect(serializer.as_json[:user_option][:chat_quick_reaction_type]).to eq("frequent")
|
|
end
|
|
end
|
|
|
|
describe "#chat_quick_reactions_custom" do
|
|
it "is present with default enum string" do
|
|
expect(serializer.as_json[:user_option][:chat_quick_reactions_custom]).to eq(nil)
|
|
end
|
|
|
|
context "with custom quick reactions" do
|
|
before { user.user_option.update!(chat_quick_reactions_custom: "tada|smiley") }
|
|
|
|
it "is present" do
|
|
expect(serializer.as_json[:user_option][:chat_quick_reactions_custom]).to eq("tada|smiley")
|
|
end
|
|
end
|
|
end
|
|
end
|