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