Skip to content

Commit

Permalink
Merge branch 'upgrade/0.28' into feat/import_authors_proposals
Browse files Browse the repository at this point in the history
  • Loading branch information
ivan-mr committed Nov 19, 2024
2 parents 9be4c8a + aabae6e commit 687b8d7
Showing 1 changed file with 5 additions and 27 deletions.
32 changes: 5 additions & 27 deletions decidim-top_comments/spec/system/most_voted_comments_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,23 +26,12 @@
it "renders the block empty" do
visit resource_path
expect(page).to have_selector(".most-voted-comments")
expect(page).to have_content("MOST VOTED COMMENTS")
expect(page).to have_content("Most voted comments")
expect(page).not_to have_selector(".comment-in-favor")
expect(page).not_to have_selector(".comment-against")

expect(page).to have_selector("#num-in-favor-comments")
counter= find("#num-in-favor-comments")
expect(counter).to have_text("0")
expect(page).to have_selector("#percent-in-favor-comments")
counter= find("#percent-in-favor-comments")
expect(counter).to have_text("(0%)")

expect(page).to have_selector("#num-against-comments")
counter= find("#num-against-comments")
expect(counter).to have_text("0")
expect(page).to have_selector("#percent-against-comments")
counter= find("#percent-against-comments")
expect(counter).to have_text("(0%)")
expect(page).to have_content("0\nin favor\n(0%)")
expect(page).to have_content("0\nagainst\n(0%)")
end
end

Expand All @@ -60,19 +49,8 @@
it "shows the number of each kind of comments" do
visit resource_path

expect(page).to have_selector("#num-in-favor-comments")
counter= find("#num-in-favor-comments")
expect(counter).to have_text("1")
expect(page).to have_selector("#percent-in-favor-comments")
counter= find("#percent-in-favor-comments")
expect(counter).to have_text("(33.3%)")

expect(page).to have_selector("#num-against-comments")
counter= find("#num-against-comments")
expect(counter).to have_text("1")
expect(page).to have_selector("#percent-against-comments")
counter= find("#percent-against-comments")
expect(counter).to have_text("(33.3%)")
expect(page).to have_content("1\nin favor\n(33.3%)")
expect(page).to have_content("1\nagainst\n(33.3%)")
end

context "when votes go to the neutral comment" do
Expand Down

0 comments on commit 687b8d7

Please sign in to comment.