@@ -235,4 +235,43 @@ void main() {
235235 checkOpacityForStreamAndBadge ('Stream 1' , 2 , 0.55 );
236236 checkOpacityForStreamAndBadge ('Stream 2' , 1 , 1.0 );
237237 });
238+
239+ testWidgets ('stream name of unmuted streams with unmuted unreads is bold' , (tester) async {
240+ void checkOpacityForStreamAndBadge (String streamName, int ? fontWeight) {
241+ final streamFinder = find.text (streamName);
242+ final foundWeight = tester.widget <Text >(streamFinder).style? .fontWeight? .value;
243+ check (foundWeight).equals (fontWeight);
244+ }
245+
246+ final unmutedStreamWithUnmutedUnreads = eg.stream (name: 'Unmuted stream with unmuted unreads' );
247+ final unmutedStreamWithNoUnmutedUnreads = eg.stream (name: 'Unmuted stream with no unmuted unreads' );
248+ final mutedStreamWithUnmutedUnreads = eg.stream (name: 'Muted stream with unmuted unreads' );
249+ final mutedStreamWithNoUnmutedUnreads = eg.stream (name: 'Muted stream with no unmuted unreads' );
250+
251+ await setupStreamListPage (tester,
252+ subscriptions: [
253+ eg.subscription (unmutedStreamWithUnmutedUnreads, isMuted: false ),
254+ eg.subscription (unmutedStreamWithNoUnmutedUnreads, isMuted: false ),
255+ eg.subscription (mutedStreamWithUnmutedUnreads, isMuted: true ),
256+ eg.subscription (mutedStreamWithNoUnmutedUnreads, isMuted: true ),
257+ ],
258+ userTopics: [
259+ eg.userTopicItem (unmutedStreamWithUnmutedUnreads, 'a' , UserTopicVisibilityPolicy .unmuted),
260+ eg.userTopicItem (unmutedStreamWithNoUnmutedUnreads, 'b' , UserTopicVisibilityPolicy .muted),
261+ eg.userTopicItem (mutedStreamWithUnmutedUnreads, 'c' , UserTopicVisibilityPolicy .unmuted),
262+ eg.userTopicItem (mutedStreamWithNoUnmutedUnreads, 'd' , UserTopicVisibilityPolicy .muted),
263+ ],
264+ unreadMsgs: eg.unreadMsgs (streams: [
265+ UnreadStreamSnapshot (streamId: unmutedStreamWithUnmutedUnreads.streamId, topic: 'a' , unreadMessageIds: [1 ]),
266+ UnreadStreamSnapshot (streamId: unmutedStreamWithNoUnmutedUnreads.streamId, topic: 'b' , unreadMessageIds: [2 ]),
267+ UnreadStreamSnapshot (streamId: mutedStreamWithUnmutedUnreads.streamId, topic: 'c' , unreadMessageIds: [2 ]),
268+ UnreadStreamSnapshot (streamId: mutedStreamWithNoUnmutedUnreads.streamId, topic: 'd' , unreadMessageIds: [2 ]),
269+ ]),
270+ );
271+
272+ checkOpacityForStreamAndBadge (unmutedStreamWithUnmutedUnreads.name, 600 );
273+ checkOpacityForStreamAndBadge (unmutedStreamWithNoUnmutedUnreads.name, 400 );
274+ checkOpacityForStreamAndBadge (mutedStreamWithUnmutedUnreads.name, 400 );
275+ checkOpacityForStreamAndBadge (mutedStreamWithNoUnmutedUnreads.name, 400 );
276+ });
238277}
0 commit comments