UX: display correct replies count in embedded comments view. (#14175)

Previosuly, the reply count included the "small_action" posts too. It also caused the broken embed HTML issue.
This commit is contained in:
Vinoth Kannan
2021-08-30 10:37:53 +05:30
committed by GitHub
parent 55b22af3b6
commit 465774cf2c
4 changed files with 19 additions and 11 deletions

View File

@@ -166,3 +166,7 @@ end
Fabricator(:whisper, from: :post) do
post_type Post.types[:whisper]
end
Fabricator(:small_action, from: :post) do
post_type Post.types[:small_action]
end

View File

@@ -229,6 +229,14 @@ describe EmbedController do
expect(response.body).to match(I18n.t('embed.continue'))
expect(response.body).to match(post.cooked)
expect(response.body).to match("<span class='replies'>1 reply</span>")
small_action = Fabricate(:small_action, topic: topic_embed.topic)
get '/embed/comments', params: { embed_url: embed_url }, headers: headers
expect(response.body).not_to match("post-#{small_action.id}")
expect(response.body).to match("<span class='replies'>1 reply</span>")
end
it "provides the topic retriever with the discourse username when provided" do