mirror of
https://github.com/discourse/discourse.git
synced 2026-08-10 04:58:31 -05:00
FIX: notification reminder is deleted with bookmark (#35069)
Prior to this fix a user could delete a chat bookmark but the notification reminder if it had already fired would still show in notifications.
This commit is contained in:
@@ -103,6 +103,37 @@ RSpec.describe "Bookmark message", type: :system do
|
||||
)
|
||||
end
|
||||
end
|
||||
|
||||
context "with reminder notification cleanup" do
|
||||
it "removes bookmark reminder notification when bookmark is deleted" do
|
||||
chat_page.visit_channel(category_channel_1)
|
||||
channel_page.bookmark_message(message_1)
|
||||
bookmark_modal.fill_name("Check this out later")
|
||||
bookmark_modal.select_preset_reminder(:tomorrow)
|
||||
|
||||
expect(channel_page).to have_bookmarked_message(message_1)
|
||||
|
||||
bookmark = Bookmark.find_by(bookmarkable: message_1, user: current_user)
|
||||
Chat::MessageBookmarkable.send_reminder_notification(
|
||||
bookmark,
|
||||
data: {
|
||||
title: bookmark.bookmarkable.chat_channel.title(current_user),
|
||||
bookmarkable_url: bookmark.bookmarkable.url,
|
||||
},
|
||||
)
|
||||
|
||||
user_menu.open
|
||||
|
||||
expect(page).to have_css("#quick-access-all-notifications .bookmark-reminder")
|
||||
|
||||
channel_page.bookmark_message(message_1)
|
||||
bookmark_modal.delete
|
||||
bookmark_modal.confirm_delete
|
||||
user_menu.open
|
||||
|
||||
expect(page).to have_no_css("#quick-access-all-notifications .bookmark-reminder")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
context "when mobile", mobile: true do
|
||||
|
||||
Reference in New Issue
Block a user