RoomListStore: Unread filter should only filter rooms having unread counts (#29555)

* Use `hasUnreadCount` instead of `isUnread`

* Fix broken test

* Write test
This commit is contained in:
R Midhun Suresh
2025-03-21 13:58:00 +05:30
committed by GitHub
parent 5a6c9a4c9a
commit 0dc295e3b8
3 changed files with 40 additions and 3 deletions

View File

@@ -457,7 +457,7 @@ describe("RoomListStoreV3", () => {
// Let's say 8, 27 are unread
jest.spyOn(RoomNotificationStateStore.instance, "getRoomState").mockImplementation((room) => {
const state = {
isUnread: [rooms[8], rooms[27]].includes(room),
hasUnreadCount: [rooms[8], rooms[27]].includes(room),
} as unknown as RoomNotificationState;
return state;
});
@@ -588,7 +588,7 @@ describe("RoomListStoreV3", () => {
// Let's say 8, 27 are unread
jest.spyOn(RoomNotificationStateStore.instance, "getRoomState").mockImplementation((room) => {
const state = {
isUnread: [rooms[8], rooms[27]].includes(room),
hasUnreadCount: [rooms[8], rooms[27]].includes(room),
} as unknown as RoomNotificationState;
return state;
});