@@ -14,6 +14,7 @@ import 'package:zulip/model/localizations.dart';
1414import 'package:zulip/model/narrow.dart' ;
1515import 'package:zulip/model/store.dart' ;
1616import 'package:zulip/widgets/content.dart' ;
17+ import 'package:zulip/widgets/icons.dart' ;
1718import 'package:zulip/widgets/message_list.dart' ;
1819import 'package:zulip/widgets/sticky_header.dart' ;
1920import 'package:zulip/widgets/store.dart' ;
@@ -249,6 +250,54 @@ void main() {
249250 matching: find.byType (ColoredBox ),
250251 ))).color.equals (swatch.barBackground);
251252 });
253+
254+ testWidgets ('color of stream icon' , (tester) async {
255+ final stream = eg.stream (isWebPublic: true );
256+ final subscription = eg.subscription (stream, color: Colors .red.value);
257+ final swatch = subscription.colorSwatch ();
258+ await setupMessageListPage (tester,
259+ messages: [eg.streamMessage (stream: subscription)],
260+ subscriptions: [subscription]);
261+ await tester.pump ();
262+ check (tester.widget <Icon >(find.byIcon (ZulipIcons .globe)))
263+ .color.equals (swatch.iconOnBarBackground);
264+ });
265+
266+ testWidgets ('normal streams show hash icon' , (tester) async {
267+ final stream = eg.stream (isWebPublic: false , inviteOnly: false );
268+ await setupMessageListPage (tester,
269+ messages: [eg.streamMessage (stream: stream)],
270+ streams: [stream]);
271+ await tester.pump ();
272+ check (find.descendant (
273+ of: find.byType (StreamMessageRecipientHeader ),
274+ matching: find.byIcon (ZulipIcons .hash_sign),
275+ ).evaluate ()).length.equals (1 );
276+ });
277+
278+ testWidgets ('public streams show globe icon' , (tester) async {
279+ final stream = eg.stream (isWebPublic: true );
280+ await setupMessageListPage (tester,
281+ messages: [eg.streamMessage (stream: stream)],
282+ streams: [stream]);
283+ await tester.pump ();
284+ check (find.descendant (
285+ of: find.byType (StreamMessageRecipientHeader ),
286+ matching: find.byIcon (ZulipIcons .globe),
287+ ).evaluate ()).length.equals (1 );
288+ });
289+
290+ testWidgets ('private streams show lock icon' , (tester) async {
291+ final stream = eg.stream (inviteOnly: true );
292+ await setupMessageListPage (tester,
293+ messages: [eg.streamMessage (stream: stream)],
294+ streams: [stream]);
295+ await tester.pump ();
296+ check (find.descendant (
297+ of: find.byType (StreamMessageRecipientHeader ),
298+ matching: find.byIcon (ZulipIcons .lock),
299+ ).evaluate ()).length.equals (1 );
300+ });
252301 });
253302
254303 testWidgets ('show stream name from message when stream unknown' , (tester) async {
0 commit comments