]> git.openstreetmap.org Git - rails.git/commitdiff
Merge remote-tracking branch 'upstream/pull/5420' live
authorTom Hughes <tom@compton.nu>
Thu, 19 Dec 2024 16:09:14 +0000 (16:09 +0000)
committerTom Hughes <tom@compton.nu>
Thu, 19 Dec 2024 16:09:14 +0000 (16:09 +0000)
test/system/resolve_note_test.rb

index 7f47e45e25543cc46c6c780b69049cea64f1d648..f9c28a999b07ac120f4518720f77dedfb73244c6 100644 (file)
@@ -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 "<iframe" # leak from share textarea
+    end
+  end
+
   test "can't resolve a note when blocked" do
     note = create(:note_with_comments)
     user = create(:user)