FIX: Dismissing unread not dismissing correctly (#26096)

Why this change?

This is a regression from introduced in
5c1147adf3 where dismissing unread topics
was changing the notification level of the topics instead of just
dismissing the unread posts.

What does this change do?

1. Bring back the previous implementation of the action
2. Fix the system test that was supposed to catch the problem but did
   not.
This commit is contained in:
Alan Guo Xiang Tan 2024-03-08 09:02:35 +08:00 committed by GitHub
parent 33b5a8448e
commit 05653e11cb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 10 additions and 4 deletions

View File

@ -201,7 +201,13 @@ export default class DiscoveryListController extends Controller {
}
@action
dismissRead(operationType, options) {
this.bulkSelectHelper.dismissRead(operationType, options);
dismissRead(dismissTopics) {
const operationType = dismissTopics ? "topics" : "posts";
this.bulkSelectHelper.dismissRead(operationType, {
categoryId: this.model.category?.id,
tagName: this.model.tag?.id,
includeSubcategories: this.model.noSubcategories,
});
}
}

View File

@ -11,7 +11,7 @@ module PageObjects
I18n.t("js.filters.new.title_with_count", count: count)
end
has_css?(".nav-item_new", text: text)
has_css?(".nav-item_new", exact_text: text)
end
def has_unread?(count:)
@ -22,7 +22,7 @@ module PageObjects
I18n.t("js.filters.unread.title_with_count", count: count)
end
has_css?(".nav-item_unread", text: text)
has_css?(".nav-item_unread", exact_text: text)
end
def dismiss_unread(untrack: false)