1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2025-08-09 10:22:46 +03:00

Emit UnreadNotification event on notifications reset (#2804)

This commit is contained in:
Germain
2022-10-26 14:23:54 +01:00
committed by GitHub
parent 9f6b42d3ae
commit dddc0aeccb
2 changed files with 15 additions and 1 deletions

View File

@@ -2723,6 +2723,19 @@ describe("Room", function() {
expect(room.getThreadUnreadNotificationCount("123", NotificationCountType.Total)).toBe(666);
expect(room.getThreadUnreadNotificationCount("456", NotificationCountType.Highlight)).toBe(0);
});
it("emits event on notifications reset", () => {
const cb = jest.fn();
room.on(RoomEvent.UnreadNotifications, cb);
room.setThreadUnreadNotificationCount("123", NotificationCountType.Total, 666);
room.setThreadUnreadNotificationCount("456", NotificationCountType.Highlight, 123);
room.resetThreadUnreadNotificationCount();
expect(cb).toHaveBeenLastCalledWith();
});
});
describe("hasThreadUnreadNotification", () => {