From eeda506ae15914d2a7a60726d89c36e176df0eb9 Mon Sep 17 00:00:00 2001 From: Anton Khorev Date: Thu, 19 Dec 2024 17:59:44 +0300 Subject: [PATCH] Test share textarea not to leak into note text on hiding resolved notes --- test/system/resolve_note_test.rb | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/test/system/resolve_note_test.rb b/test/system/resolve_note_test.rb index 7f47e45e25..f9c28a999b 100644 --- a/test/system/resolve_note_test.rb +++ b/test/system/resolve_note_test.rb @@ -58,6 +58,37 @@ class ResolveNoteTest < ApplicationSystemTestCase end end + test "can hide an open note as moderator" do + note = create(:note_with_comments) + user = create(:moderator_user) + sign_in_as(user) + visit note_path(note) + + within_sidebar do + assert_button "Hide" + + click_on "Hide" + + assert_content "Hidden note ##{note.id}" + end + end + + test "can hide a closed note as moderator" do + note = create(:note_with_comments, :closed) + user = create(:moderator_user) + sign_in_as(user) + visit note_path(note) + + within_sidebar do + assert_button "Hide" + + click_on "Hide" + + assert_content "Hidden note ##{note.id}" + assert_no_content "