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