1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2025-08-07 23:02:56 +03:00

Add support for unread thread notifications (#2726)

This commit is contained in:
Germain
2022-10-05 10:37:45 +01:00
committed by GitHub
parent ff720e3aa3
commit 21a6f61b7b
16 changed files with 551 additions and 40 deletions

View File

@@ -30,6 +30,12 @@ const RES_WITH_AGE = {
account_data: { events: [] },
ephemeral: { events: [] },
unread_notifications: {},
unread_thread_notifications: {
"$143273582443PhrSn:example.org": {
highlight_count: 0,
notification_count: 1,
},
},
timeline: {
events: [
Object.freeze({
@@ -439,6 +445,13 @@ describe("SyncAccumulator", function() {
Object.keys(RES_WITH_AGE.rooms.join["!foo:bar"].timeline.events[0]),
);
});
it("should retrieve unread thread notifications", () => {
sa.accumulate(RES_WITH_AGE);
const output = sa.getJSON();
expect(output.roomsData.join["!foo:bar"]
.unread_thread_notifications["$143273582443PhrSn:example.org"]).not.toBeUndefined();
});
});
});