Fix: dismiss grouped notifications by card from the notifications tray

This also splits the templates into two: index and tray, since the URL now changes.
This commit is contained in:
Jorge Manrubia
2025-11-14 12:58:24 +01:00
parent 37e6b2461e
commit eea9afb639
11 changed files with 130 additions and 32 deletions
+35
View File
@@ -27,6 +27,41 @@ class Card::ReadableTest < ActiveSupport::TestCase
end
end
test "unread marks events notifications as unread" do
notifications(:logo_published_kevin).read
notifications(:logo_assignment_kevin).read
assert_changes -> { notifications(:logo_published_kevin).reload.read? }, from: true, to: false do
assert_changes -> { notifications(:logo_assignment_kevin).reload.read? }, from: true, to: false do
cards(:logo).unread_by(users(:kevin))
end
end
end
test "unread marks mentions in the description as unread" do
notifications(:logo_card_david_mention_by_jz).read
assert_changes -> { notifications(:logo_card_david_mention_by_jz).reload.read? }, from: true, to: false do
cards(:logo).unread_by(users(:david))
end
end
test "unread marks mentions in comments as unread" do
notifications(:logo_comment_david_mention_by_jz).read
assert_changes -> { notifications(:logo_comment_david_mention_by_jz).reload.read? }, from: true, to: false do
cards(:logo).unread_by(users(:david))
end
end
test "unread marks notifications from the comments as unread" do
notifications(:layout_commented_kevin).read
assert_changes -> { notifications(:layout_commented_kevin).reload.read? }, from: true, to: false do
cards(:layout).unread_by(users(:kevin))
end
end
test "remove inaccessible notifications" do
card = cards(:logo)
kevin = users(:kevin)