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