@@ -6,6 +6,7 @@ import 'package:zulip/api/model/model.dart';
6
6
import 'package:zulip/widgets/icons.dart' ;
7
7
import 'package:zulip/widgets/channel_colors.dart' ;
8
8
import 'package:zulip/widgets/subscription_list.dart' ;
9
+ import 'package:zulip/widgets/text.dart' ;
9
10
import 'package:zulip/widgets/unread_count_badge.dart' ;
10
11
11
12
import '../flutter_checks.dart' ;
@@ -233,4 +234,43 @@ void main() {
233
234
checkOpacityForStreamAndBadge ('Stream 1' , 2 , 0.55 );
234
235
checkOpacityForStreamAndBadge ('Stream 2' , 1 , 1.0 );
235
236
});
237
+
238
+ testWidgets ('stream name of unmuted streams with unmuted unreads is bold' , (tester) async {
239
+ void checkStreamNameWght (String streamName, double ? expectedWght) {
240
+ final streamFinder = find.text (streamName);
241
+ final wght = wghtFromTextStyle (tester.widget <Text >(streamFinder).style! );
242
+ check (wght).equals (expectedWght);
243
+ }
244
+
245
+ final unmutedStreamWithUnmutedUnreads = eg.stream (name: 'Unmuted stream with unmuted unreads' );
246
+ final unmutedStreamWithNoUnmutedUnreads = eg.stream (name: 'Unmuted stream with no unmuted unreads' );
247
+ final mutedStreamWithUnmutedUnreads = eg.stream (name: 'Muted stream with unmuted unreads' );
248
+ final mutedStreamWithNoUnmutedUnreads = eg.stream (name: 'Muted stream with no unmuted unreads' );
249
+
250
+ await setupStreamListPage (tester,
251
+ subscriptions: [
252
+ eg.subscription (unmutedStreamWithUnmutedUnreads, isMuted: false ),
253
+ eg.subscription (unmutedStreamWithNoUnmutedUnreads, isMuted: false ),
254
+ eg.subscription (mutedStreamWithUnmutedUnreads, isMuted: true ),
255
+ eg.subscription (mutedStreamWithNoUnmutedUnreads, isMuted: true ),
256
+ ],
257
+ userTopics: [
258
+ eg.userTopicItem (unmutedStreamWithUnmutedUnreads, 'a' , UserTopicVisibilityPolicy .unmuted),
259
+ eg.userTopicItem (unmutedStreamWithNoUnmutedUnreads, 'b' , UserTopicVisibilityPolicy .muted),
260
+ eg.userTopicItem (mutedStreamWithUnmutedUnreads, 'c' , UserTopicVisibilityPolicy .unmuted),
261
+ eg.userTopicItem (mutedStreamWithNoUnmutedUnreads, 'd' , UserTopicVisibilityPolicy .muted),
262
+ ],
263
+ unreadMsgs: eg.unreadMsgs (channels: [
264
+ UnreadChannelSnapshot (streamId: unmutedStreamWithUnmutedUnreads.streamId, topic: 'a' , unreadMessageIds: [1 ]),
265
+ UnreadChannelSnapshot (streamId: unmutedStreamWithNoUnmutedUnreads.streamId, topic: 'b' , unreadMessageIds: [2 ]),
266
+ UnreadChannelSnapshot (streamId: mutedStreamWithUnmutedUnreads.streamId, topic: 'c' , unreadMessageIds: [3 ]),
267
+ UnreadChannelSnapshot (streamId: mutedStreamWithNoUnmutedUnreads.streamId, topic: 'd' , unreadMessageIds: [4 ]),
268
+ ]),
269
+ );
270
+
271
+ checkStreamNameWght (unmutedStreamWithUnmutedUnreads.name, 600 );
272
+ checkStreamNameWght (unmutedStreamWithNoUnmutedUnreads.name, 400 );
273
+ checkStreamNameWght (mutedStreamWithUnmutedUnreads.name, 400 );
274
+ checkStreamNameWght (mutedStreamWithNoUnmutedUnreads.name, 400 );
275
+ });
236
276
}
0 commit comments