@@ -305,6 +305,53 @@ void main() {
305305 });
306306 });
307307
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+ streams: [channel],
316+ subscriptions: [eg.subscription (channel)],
317+ unreadMessages: [message]);
318+ await store.addUserTopic (channel, topic, UserTopicVisibilityPolicy .followed);
319+ await tester.pump ();
320+ check (hasIcon (tester,
321+ parent: findRowByLabel (tester, topic),
322+ icon: ZulipIcons .follow)).isTrue ();
323+ });
324+
325+ testWidgets ('followed and mentioned' , (tester) async {
326+ await setupPage (tester,
327+ streams: [channel],
328+ subscriptions: [eg.subscription (channel)],
329+ unreadMessages: [eg.streamMessage (stream: channel, topic: topic,
330+ flags: [MessageFlag .mentioned])]);
331+ await store.addUserTopic (channel, topic, UserTopicVisibilityPolicy .followed);
332+ await tester.pump ();
333+ check (hasIcon (tester,
334+ parent: findRowByLabel (tester, topic),
335+ icon: ZulipIcons .follow)).isTrue ();
336+ check (hasIcon (tester,
337+ parent: findRowByLabel (tester, topic),
338+ icon: ZulipIcons .at_sign)).isTrue ();
339+ });
340+
341+ testWidgets ('unmuted' , (tester) async {
342+ await setupPage (tester,
343+ users: [eg.selfUser, eg.otherUser],
344+ streams: [channel],
345+ subscriptions: [eg.subscription (channel, isMuted: true )],
346+ unreadMessages: [message]);
347+ await store.addUserTopic (channel, topic, UserTopicVisibilityPolicy .unmuted);
348+ await tester.pump ();
349+ check (hasIcon (tester,
350+ parent: findRowByLabel (tester, topic),
351+ icon: ZulipIcons .unmute)).isTrue ();
352+ });
353+ });
354+
308355 group ('collapsing' , () {
309356 Icon findHeaderCollapseIcon (WidgetTester tester, Widget headerRow) {
310357 return tester.widget (
0 commit comments