Replace the full container since we want to get back to the initial state
To see the boost button again
This commit is contained in:
@@ -1 +1,3 @@
|
||||
<%= turbo_stream.append([ @comment, :reactions ], partial: "cards/comments/reactions/reaction", locals: { reaction: @reaction }) %>
|
||||
<%= turbo_stream.replace([ @comment, :reacting ]) do %>
|
||||
<%= render "cards/comments/reactions/reactions", comment: @comment.reload %>
|
||||
<% end %>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<%= form_with model: [ @comment.card, @comment, Reaction.new ],
|
||||
class: "reaction reaction__form expanded",
|
||||
html: { aria: { label: "New reaction" } },
|
||||
data: { controller: "form reaction-emoji", turbo_frame: dom_id(@comment, :reacting), action: "keydown.esc->form#cancel submit->form#preventEmptySubmit turbo:submit-end->form#reset" } do |form| %>
|
||||
data: { controller: "form reaction-emoji", turbo_frame: dom_id(@comment, :reacting), action: "keydown.esc->form#cancel submit->form#preventEmptySubmit" } do |form| %>
|
||||
<label class="reaction__form-label flex gap" style="--column-gap: 0.4ch;">
|
||||
<figure class="reaction__avatar margin-none flex-item-no-shrink">
|
||||
<%= avatar_tag Current.user %>
|
||||
|
||||
@@ -10,7 +10,7 @@ class Cards::Comments::ReactionsControllerTest < ActionDispatch::IntegrationTest
|
||||
test "create" do
|
||||
assert_difference -> { @comment.reactions.count }, 1 do
|
||||
post card_comment_reactions_path(@comment.card, @comment, format: :turbo_stream), params: { reaction: { content: "Great work!" } }
|
||||
assert_turbo_stream action: :append, target: dom_id(@comment, :reactions)
|
||||
assert_turbo_stream action: :replace, target: dom_id(@comment, :reacting)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user