diff --git a/app/assets/stylesheets/views/article.scss b/app/assets/stylesheets/views/article.scss index 9a7bb6dab..b1313d99e 100644 --- a/app/assets/stylesheets/views/article.scss +++ b/app/assets/stylesheets/views/article.scss @@ -477,7 +477,7 @@ height: 28px; } - svg { + img { margin: 3px 3px; } diff --git a/app/views/articles/_single_story.html.erb b/app/views/articles/_single_story.html.erb index fea87b366..6f159918f 100644 --- a/app/views/articles/_single_story.html.erb +++ b/app/views/articles/_single_story.html.erb @@ -123,12 +123,14 @@ <% if FeatureFlag.enabled?(:multiple_reactions) %> ">
- <% ReactionCategory.for_view.each do |reaction_type| %> - <% next unless story.reaction_categories.include?(reaction_type.slug.to_s) %> - - <%= image_tag reaction_type.icon, size: "18x18" %> - - <% end %> + + <% ReactionCategory.for_view.reverse_each do |reaction_type| %> + <% next unless story.reaction_categories.include?(reaction_type.slug.to_s) %> + + <%= image_tag reaction_type.icon, size: "18x18" %> + + <% end %> + <%= t("views.reactions.summary.count_html", count: story.public_reactions_count, start: tag("span", { class: %w[hidden s:inline] }, true), diff --git a/spec/decorators/notification_decorator_spec.rb b/spec/decorators/notification_decorator_spec.rb index 493f9dd1a..381331f72 100644 --- a/spec/decorators/notification_decorator_spec.rb +++ b/spec/decorators/notification_decorator_spec.rb @@ -62,6 +62,17 @@ RSpec.describe NotificationDecorator, type: :decorator do notification = build(:notification, action: "Milestone::Reaction::64") expect(notification.decorate.milestone_type).to eq("Reaction") end + + it "is a milestone type" do + notification = build(:notification, action: "Milestone::Reaction::64") + expect(notification.notifiable_type).to eq("Article") + expect(notification.decorate).to be_milestone + end + + it "is also a milestone type if has milestone type" do + notification = build(:notification, notifiable_type: "Milestone") + expect(notification.decorate).to be_milestone + end end describe "#milestone_count" do @@ -113,6 +124,10 @@ RSpec.describe NotificationDecorator, type: :decorator do expect(decorated.reactable_title).to eq("This is the article's title here") end + it "responds to reactable_type" do + expect(decorated.reactable_type).to be_nil + end + it "responds to reaction_category" do expect(decorated.reaction_category).to eq("like") end @@ -174,6 +189,10 @@ RSpec.describe NotificationDecorator, type: :decorator do expect(decorated.reactable_title).to be_nil end + it "responds to reactable_type" do + expect(decorated.reactable_type).to be_nil + end + it "responds to reaction_category" do expect(decorated.reaction_category).to eq("like") end