@@ -305,6 +305,56 @@ void main() {
305
305
});
306
306
});
307
307
308
+ group ('topic visibility' , () {
309
+ final channel = eg.stream ();
310
+ const topic = 'topic' ;
311
+ final message = eg.streamMessage (stream: channel, topic: topic);
312
+
313
+ testWidgets ('followed' , (tester) async {
314
+ await setupPage (tester,
315
+ users: [eg.selfUser, eg.otherUser],
316
+ streams: [channel],
317
+ subscriptions: [eg.subscription (channel)],
318
+ unreadMessages: [message]);
319
+ await store.addUserTopic (channel, topic, UserTopicVisibilityPolicy .followed);
320
+ await tester.pump ();
321
+ check (hasIcon (tester,
322
+ parent: findRowByLabel (tester, topic),
323
+ icon: ZulipIcons .follow)).isTrue ();
324
+ });
325
+
326
+ testWidgets ('followed and mentioned' , (tester) async {
327
+ await setupPage (tester,
328
+ users: [eg.selfUser, eg.otherUser],
329
+ streams: [channel],
330
+ subscriptions: [eg.subscription (channel)],
331
+ unreadMessages: [eg.streamMessage (stream: channel, topic: topic,
332
+ flags: [MessageFlag .mentioned])]);
333
+ await store.addUserTopic (channel, topic, UserTopicVisibilityPolicy .followed);
334
+ await tester.pump ();
335
+ check (hasIcon (tester,
336
+ parent: findRowByLabel (tester, topic),
337
+ icon: ZulipIcons .follow)).isTrue ();
338
+ check (hasIcon (tester,
339
+ parent: findRowByLabel (tester, topic),
340
+ icon: ZulipIcons .at_sign)).isTrue ();
341
+ });
342
+
343
+
344
+ testWidgets ('unmuted' , (tester) async {
345
+ await setupPage (tester,
346
+ users: [eg.selfUser, eg.otherUser],
347
+ streams: [channel],
348
+ subscriptions: [eg.subscription (channel, isMuted: true )],
349
+ unreadMessages: [message]);
350
+ await store.addUserTopic (channel, topic, UserTopicVisibilityPolicy .unmuted);
351
+ await tester.pump ();
352
+ check (hasIcon (tester,
353
+ parent: findRowByLabel (tester, topic),
354
+ icon: ZulipIcons .unmute)).isTrue ();
355
+ });
356
+ });
357
+
308
358
group ('collapsing' , () {
309
359
Icon findHeaderCollapseIcon (WidgetTester tester, Widget headerRow) {
310
360
return tester.widget (
0 commit comments