Update calls to addEventToTimeline and addLiveEvents for new signature

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
Michael Telatynski 2024-11-06 14:55:21 +00:00
parent a355292a7f
commit 044eaf7eb5
No known key found for this signature in database
GPG key ID: A2B008A5F49F5D0D
34 changed files with 166 additions and 131 deletions

View file

@ -593,18 +593,21 @@ describe("HTMLExport", () => {
it("should not make /messages requests when exporting 'Current Timeline'", async () => {
client.createMessagesRequest.mockRejectedValue(new Error("Should never be called"));
room.addLiveEvents([
new MatrixEvent({
event_id: `$eventId`,
type: EventType.RoomMessage,
sender: client.getSafeUserId(),
origin_server_ts: 123456789,
content: {
msgtype: "m.text",
body: `testing testing`,
},
}),
]);
room.addLiveEvents(
[
new MatrixEvent({
event_id: `$eventId`,
type: EventType.RoomMessage,
sender: client.getSafeUserId(),
origin_server_ts: 123456789,
content: {
msgtype: "m.text",
body: `testing testing`,
},
}),
],
{ addToState: true },
);
const exporter = new HTMLExporter(
room,

View file

@ -121,7 +121,7 @@ describe("notifications", () => {
user: USER_ID,
msg: "Hello",
});
room.addLiveEvents([message]);
room.addLiveEvents([message], { addToState: true });
sendReadReceiptSpy = jest.spyOn(client, "sendReadReceipt").mockResolvedValue({});
jest.spyOn(client, "getRooms").mockReturnValue([room]);
jest.spyOn(SettingsStore, "getValue").mockImplementation((name) => {
@ -187,7 +187,7 @@ describe("notifications", () => {
user: USER_ID,
ts: 1,
});
room.addLiveEvents([message]);
room.addLiveEvents([message], { addToState: true });
room.setUnreadNotificationCount(NotificationCountType.Total, 1);
await clearAllNotifications(client);
@ -202,7 +202,7 @@ describe("notifications", () => {
user: USER_ID,
ts: 1,
});
room.addLiveEvents([message]);
room.addLiveEvents([message], { addToState: true });
room.setUnreadNotificationCount(NotificationCountType.Total, 1);
jest.spyOn(SettingsStore, "getValue").mockReset().mockReturnValue(false);