Update tests in anticipation of matrix-js-sdk#3901 (#11956)

* Update tests in anticipation of matrix-js-sdk#3901

* Formatting
This commit is contained in:
Andy Balaam 2023-11-28 13:59:03 +00:00 committed by GitHub
parent 83f0650ed4
commit e76a37e01f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 58 additions and 5 deletions

View file

@ -106,6 +106,21 @@ describe("LegacyRoomHeaderButtons-test.tsx", function () {
authorId: client.getUserId()!,
participantUserIds: ["@alice:example.org"],
});
// We need some receipt, otherwise we treat this thread as
// "older than all threaded receipts" and consider it read.
let receipt = new MatrixEvent({
type: "m.receipt",
room_id: room.roomId,
content: {
[events[0].getId()!]: {
// Receipt for the first event in the thread
[ReceiptType.Read]: {
[client.getUserId()!]: { ts: 1, thread_id: rootEvent.getId() },
},
},
},
});
room.addReceipt(receipt);
expect(isIndicatorOfType(container, "bold")).toBe(true);
// Sending the last event should clear the notification.
@ -145,7 +160,7 @@ describe("LegacyRoomHeaderButtons-test.tsx", function () {
expect(isIndicatorOfType(container, "bold")).toBe(true);
// Sending a read receipt on an earlier event shouldn't do anything.
let receipt = new MatrixEvent({
receipt = new MatrixEvent({
type: "m.receipt",
room_id: room.roomId,
content: {