Fix a test that would otherwise be broken by matrix-js-sdk#3817 (#11826)

pull/28217/head
Andy Balaam 2023-11-02 15:41:45 +00:00 committed by GitHub
parent 01e7e01153
commit f48cee238a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 0 deletions

View File

@ -291,6 +291,10 @@ describe("TimelinePanel", () => {
it("and forgetting the read markers, should send the stored marker again", async () => { it("and forgetting the read markers, should send the stored marker again", async () => {
timelineSet.addLiveEvent(ev2, {}); timelineSet.addLiveEvent(ev2, {});
// Add the event to the room as well as the timeline, so we can find it when we
// call findEventById in getEventReadUpTo. This is odd because in our test
// setup, timelineSet is not actually the timelineSet of the room.
await room.addLiveEvents([ev2], {});
room.addEphemeralEvents([newReceipt(ev2.getId()!, userId, 222, 200)]); room.addEphemeralEvents([newReceipt(ev2.getId()!, userId, 222, 200)]);
await timelinePanel.forgetReadMarker(); await timelinePanel.forgetReadMarker();
expect(client.setRoomReadMarkers).toHaveBeenCalledWith(roomId, ev2.getId()); expect(client.setRoomReadMarkers).toHaveBeenCalledWith(roomId, ev2.getId());