Update parent comment responses count when a new reply is created
Extract the needed portion of code to a new partial to be able to update only the elements needed when a new comment is added keeping UI properly updated.
This commit is contained in:
@@ -264,6 +264,23 @@ describe "Commenting topics from proposals" do
|
||||
expect(page).not_to have_selector("#js-comment-form-comment_#{comment.id}", visible: true)
|
||||
end
|
||||
|
||||
scenario "Reply update parent comment responses count", :js do
|
||||
community = proposal.community
|
||||
topic = create(:topic, community: community)
|
||||
comment = create(:comment, commentable: topic)
|
||||
|
||||
login_as(create(:user))
|
||||
visit community_topic_path(community, topic)
|
||||
|
||||
within ".comment", text: comment.body do
|
||||
click_link "Reply"
|
||||
fill_in "Leave your comment", with: "It will be done next week."
|
||||
click_button "Publish reply"
|
||||
|
||||
expect(page).to have_content("1 response (collapse)")
|
||||
end
|
||||
end
|
||||
|
||||
scenario "Errors on reply", :js do
|
||||
community = proposal.community
|
||||
topic = create(:topic, community: community)
|
||||
|
||||
Reference in New Issue
Block a user