mirror of
https://github.com/Novaloop-AG/healthchat-web.git
synced 2026-11-04 00:48:47 +00:00
Room notification state: add clearer methods, documentation and deprecation (#29564)
* feat(notification state): add clearer methods, documentation and deprecation * test(room notification state): add tests for new attributes * doc: more explicit documentation for `hasUnreadCount` * doc: add link to `RoomNotificationState.isMention` in `hasMentions` doc * refactor: change `isSilent` to `hasAnyNotificationOrActivity` * refactor: add `invited` to `determineUnreadState` and use it in `NotificationState` & `RoomNotificationState` * test: update `RoomNotificationState` test to use `invited` * test: update other tests to add `invited` * refactor: remove count check in `isNotification`
This commit is contained in:
+6
-3
@@ -67,9 +67,9 @@ describe("ImportanceAlgorithm", () => {
|
||||
};
|
||||
|
||||
const unreadStates: Record<string, ReturnType<(typeof RoomNotifs)["determineUnreadState"]>> = {
|
||||
red: { symbol: null, count: 1, level: NotificationLevel.Highlight },
|
||||
grey: { symbol: null, count: 1, level: NotificationLevel.Notification },
|
||||
none: { symbol: null, count: 0, level: NotificationLevel.None },
|
||||
red: { symbol: null, count: 1, level: NotificationLevel.Highlight, invited: false },
|
||||
grey: { symbol: null, count: 1, level: NotificationLevel.Notification, invited: false },
|
||||
none: { symbol: null, count: 0, level: NotificationLevel.None, invited: false },
|
||||
};
|
||||
|
||||
beforeEach(() => {
|
||||
@@ -77,6 +77,7 @@ describe("ImportanceAlgorithm", () => {
|
||||
symbol: null,
|
||||
count: 0,
|
||||
level: NotificationLevel.None,
|
||||
invited: false,
|
||||
});
|
||||
});
|
||||
|
||||
@@ -183,6 +184,7 @@ describe("ImportanceAlgorithm", () => {
|
||||
symbol: null,
|
||||
count: 0,
|
||||
level: NotificationLevel.None,
|
||||
invited: false,
|
||||
});
|
||||
const algorithm = setupAlgorithm(sortAlgorithm);
|
||||
|
||||
@@ -353,6 +355,7 @@ describe("ImportanceAlgorithm", () => {
|
||||
symbol: null,
|
||||
count: 0,
|
||||
level: NotificationLevel.None,
|
||||
invited: false,
|
||||
});
|
||||
const algorithm = setupAlgorithm(sortAlgorithm);
|
||||
|
||||
|
||||
@@ -190,6 +190,7 @@ describe("NaturalAlgorithm", () => {
|
||||
symbol: null,
|
||||
count: 0,
|
||||
level: NotificationLevel.None,
|
||||
invited: false,
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user