@@ -191,16 +191,18 @@ void main() {
191191 await store.addSubscription (eg.subscription (stream2));
192192 await store.addSubscription (eg.subscription (stream3, isMuted: true ));
193193 await store.setUserTopic (stream1, 'a' , UserTopicVisibilityPolicy .muted);
194+ await store.setMutedUsers ([eg.thirdUser.userId]);
194195 fillWithMessages ([
195196 eg.streamMessage (stream: stream1, topic: 'a' , flags: []),
196197 eg.streamMessage (stream: stream1, topic: 'b' , flags: []),
197198 eg.streamMessage (stream: stream1, topic: 'b' , flags: []),
198199 eg.streamMessage (stream: stream2, topic: 'c' , flags: []),
199200 eg.streamMessage (stream: stream3, topic: 'd' , flags: []),
200201 eg.dmMessage (from: eg.otherUser, to: [eg.selfUser], flags: []),
202+ // Exclude because user is muted
201203 eg.dmMessage (from: eg.thirdUser, to: [eg.selfUser], flags: []),
202204 ]);
203- check (model.countInCombinedFeedNarrow ()).equals (5 );
205+ check (model.countInCombinedFeedNarrow ()).equals (4 );
204206 });
205207
206208 test ('countInChannel/Narrow' , () async {
@@ -274,12 +276,16 @@ void main() {
274276
275277 test ('countInAllDms' , () async {
276278 prepare ();
279+ await store.setMutedUsers ([eg.thirdUser.userId]);
277280 fillWithMessages ([
281+ // No one is muted: don't exclude
278282 eg.dmMessage (from: eg.otherUser, to: [eg.selfUser], flags: []),
283+ // Everyone is muted: exclude
279284 eg.dmMessage (from: eg.thirdUser, to: [eg.selfUser], flags: []),
285+ // One is muted, one isn't: don't exclude
280286 eg.dmMessage (from: eg.thirdUser, to: [eg.selfUser, eg.otherUser], flags: []),
281287 ]);
282- check (model.countInCombinedFeedNarrow ()).equals (3 );
288+ check (model.countInCombinedFeedNarrow ()).equals (2 );
283289 });
284290 });
285291
0 commit comments