You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-07-31 13:44:28 +03:00
GYU: Fix issues with audible keywords without activated mentions (#11218)
This commit is contained in:
committed by
GitHub
parent
d0147561d7
commit
b179f5562e
@ -190,4 +190,37 @@ describe("NotificationSettings", () => {
|
||||
expect(pendingChanges.deleted).toHaveLength(0);
|
||||
expect(pendingChanges.updated).toHaveLength(0);
|
||||
});
|
||||
|
||||
it("correctly handles audible keywords without mentions settings", async () => {
|
||||
const pushRules = (await import("./pushrules_bug_keyword_only.json")) as IPushRules;
|
||||
const model = toNotificationSettings(pushRules, false);
|
||||
const pendingChanges = reconcileNotificationSettings(pushRules, model, false);
|
||||
const expectedModel: NotificationSettings = {
|
||||
globalMute: false,
|
||||
defaultLevels: {
|
||||
dm: RoomNotifState.MentionsOnly,
|
||||
room: RoomNotifState.MentionsOnly,
|
||||
},
|
||||
sound: {
|
||||
calls: "ring",
|
||||
mentions: "default",
|
||||
people: undefined,
|
||||
},
|
||||
activity: {
|
||||
bot_notices: true,
|
||||
invite: true,
|
||||
status_event: false,
|
||||
},
|
||||
mentions: {
|
||||
user: false,
|
||||
room: true,
|
||||
keywords: true,
|
||||
},
|
||||
keywords: ["janne"],
|
||||
};
|
||||
expect(model).toEqual(expectedModel);
|
||||
expect(pendingChanges.added).toHaveLength(0);
|
||||
expect(pendingChanges.deleted).toHaveLength(0);
|
||||
expect(pendingChanges.updated).toHaveLength(0);
|
||||
});
|
||||
});
|
||||
|
Reference in New Issue
Block a user