From 1291505546261d5df5bd055ca6d728907d2bba1b Mon Sep 17 00:00:00 2001 From: evazion Date: Tue, 1 Oct 2019 00:18:11 -0500 Subject: [PATCH] Fix blacklists not working on /comments page. This rule: .post-preview.blacklisted-active, #image-container.blacklisted-active, #c-comments .post.blacklisted-active { display: none; } was being overridden by this rule: div#c-comments div#a-index div.post, div#c-comments div#a-show div.post { display: flex; } --- app/javascript/src/styles/common/blacklists.scss | 2 +- test/system/blacklist_test.rb | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 test/system/blacklist_test.rb diff --git a/app/javascript/src/styles/common/blacklists.scss b/app/javascript/src/styles/common/blacklists.scss index 6cc544d4a..bd4499a4c 100644 --- a/app/javascript/src/styles/common/blacklists.scss +++ b/app/javascript/src/styles/common/blacklists.scss @@ -41,5 +41,5 @@ } .post-preview.blacklisted-active, #image-container.blacklisted-active, #c-comments .post.blacklisted-active { - display: none; + display: none !important; } diff --git a/test/system/blacklist_test.rb b/test/system/blacklist_test.rb new file mode 100644 index 000000000..bc792d0d0 --- /dev/null +++ b/test/system/blacklist_test.rb @@ -0,0 +1,16 @@ +require "application_system_test_case" + +class BlacklistTest < ApplicationSystemTestCase + context "Blacklists" do + context "on the /comments page" do + should "hide the entire post" do + user = create(:user, created_at: 1.month.ago) + post = create(:post, tag_string: "spoilers") + comment = as(user) { create(:comment, post: post) } + + visit comments_path + assert_selector ".post", visible: :hidden + end + end + end +end