@@ -19,6 +19,7 @@ import 'package:zulip/model/message_list.dart';
19
19
import 'package:zulip/model/narrow.dart' ;
20
20
import 'package:zulip/model/store.dart' ;
21
21
import 'package:zulip/model/typing_status.dart' ;
22
+ import 'package:zulip/widgets/app_bar.dart' ;
22
23
import 'package:zulip/widgets/autocomplete.dart' ;
23
24
import 'package:zulip/widgets/color.dart' ;
24
25
import 'package:zulip/widgets/compose_box.dart' ;
@@ -211,6 +212,36 @@ void main() {
211
212
channel.name, eg.defaultRealmEmptyTopicDisplayName);
212
213
});
213
214
215
+ void testChannelIconInChannelRow (IconData expectedIcon, {
216
+ required bool isWebPublic,
217
+ required bool inviteOnly,
218
+ }) {
219
+ final description = 'channel icon in channel row; '
220
+ 'web-public: $isWebPublic , invite-only: $inviteOnly ' ;
221
+ testWidgets (description, (tester) async {
222
+ final color = 0xff95a5fd ;
223
+
224
+ final channel = eg.stream (isWebPublic: isWebPublic, inviteOnly: inviteOnly);
225
+ final subscription = eg.subscription (channel, color: color);
226
+
227
+ await setupMessageListPage (tester,
228
+ narrow: ChannelNarrow (channel.streamId),
229
+ streams: [channel],
230
+ subscriptions: [subscription],
231
+ messages: [eg.streamMessage (stream: channel)]);
232
+
233
+ final iconElement = tester.element (find.descendant (
234
+ of: find.byType (ZulipAppBar ),
235
+ matching: find.byIcon (expectedIcon)));
236
+
237
+ check (Theme .brightnessOf (iconElement)).equals (Brightness .light);
238
+ check (iconElement.widget as Icon ).color.equals (Color (0xff5972fc ));
239
+ });
240
+ }
241
+ testChannelIconInChannelRow (ZulipIcons .globe, isWebPublic: true , inviteOnly: false );
242
+ testChannelIconInChannelRow (ZulipIcons .lock, isWebPublic: false , inviteOnly: true );
243
+ testChannelIconInChannelRow (ZulipIcons .hash_sign, isWebPublic: false , inviteOnly: false );
244
+
214
245
testWidgets ('has channel-feed action for topic narrows' , (tester) async {
215
246
final pushedRoutes = < Route <void >> [];
216
247
final navObserver = TestNavigatorObserver ()
0 commit comments