mirror of
https://github.com/discourse/discourse.git
synced 2025-06-04 22:07:17 +08:00
FIX: correctly exclude muted channels from thread unreads (#25339)
This commit is contained in:
@ -64,6 +64,14 @@ describe Chat::ThreadUnreadsQuery do
|
||||
)
|
||||
end
|
||||
|
||||
it "does not count messages in muted channels" do
|
||||
channel_1.membership_for(current_user).update!(muted: true)
|
||||
|
||||
expect(query.map(&:to_h).find { |tracking| tracking[:thread_id] == thread_1.id }).to eq(
|
||||
{ channel_id: channel_1.id, mention_count: 0, thread_id: thread_1.id, unread_count: 0 },
|
||||
)
|
||||
end
|
||||
|
||||
it "does not messages in threads where threading_enabled is false on the channel" do
|
||||
channel_1.update!(threading_enabled: false)
|
||||
expect(query.map(&:to_h).find { |tracking| tracking[:thread_id] == thread_1.id }).to eq(
|
||||
|
@ -33,6 +33,11 @@ RSpec.describe Chat::TrackingStateReportQuery do
|
||||
fab!(:channel_2) { Fabricate(:category_channel) }
|
||||
let(:channel_ids) { [channel_1.id, channel_2.id] }
|
||||
|
||||
before do
|
||||
channel_1.add(current_user)
|
||||
channel_2.add(current_user)
|
||||
end
|
||||
|
||||
it "calls the channel unreads query with the corect params" do
|
||||
Chat::ChannelUnreadsQuery
|
||||
.expects(:call)
|
||||
|
Reference in New Issue
Block a user