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