diff --git a/lib/presentation/mixins/chat_list_item_mixin.dart b/lib/presentation/mixins/chat_list_item_mixin.dart index 177d03032b..437f6417cd 100644 --- a/lib/presentation/mixins/chat_list_item_mixin.dart +++ b/lib/presentation/mixins/chat_list_item_mixin.dart @@ -213,14 +213,17 @@ mixin ChatListItemMixin { required BuildContext context, required Room room, }) { + if (room.highlightCount > 0 || room.membership == Membership.invite) { + return Theme.of(context).colorScheme.primary; + } if (room.notificationCount > 0 && room.pushRuleState != PushRuleState.notify) { return LinagoraRefColors.material().tertiary[30]; } - if (room.notificationCount > 0) { - return Theme.of(context).colorScheme.primary; + if (room.markedUnread) { + return LinagoraRefColors.material().tertiary[30]; } - if (room.membership == Membership.invite) { + if (room.notificationCount > 0) { return Theme.of(context).colorScheme.primary; } return Colors.transparent; diff --git a/test/mixin/chat/chat_list_item_mixin_test.dart b/test/mixin/chat/chat_list_item_mixin_test.dart index fd70d83ff6..9a3921c346 100644 --- a/test/mixin/chat/chat_list_item_mixin_test.dart +++ b/test/mixin/chat/chat_list_item_mixin_test.dart @@ -91,5 +91,20 @@ void main() { expect(color, LinagoraRefColors.material().tertiary[30]); }); + + testWidgets( + 'WHEN marked unread for room\n' + 'THEN color should be tertiary[30]\n', ( + WidgetTester tester, + ) async { + when(room.markedUnread).thenReturn(true); + + final color = chatListItemMixinTest.notificationColor( + context: context, + room: room, + ); + + expect(color, LinagoraRefColors.material().tertiary[30]); + }); }); }