Attempt to deflake a read-receipts test (#11981)

* Attempt to deflake a read-receipts test

Hopefully, this will fix https://github.com/vector-im/element-web/issues/26679

(I think that the fourth message was arriving *after* the room was marked as
read, meaning that we ended up with two unread messages rather than one.)

* Update cypress/e2e/read-receipts/new-messages.spec.ts

* prettier
pull/28217/head
Richard van der Hoff 2023-12-01 11:11:14 +00:00 committed by GitHub
parent 50c58ec693
commit 1f06d97ffe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 0 deletions

View File

@ -378,8 +378,13 @@ describe("Read receipts", () => {
// Given 2 threads exist, and Thread2 has the latest message in it
goTo(room1);
receiveMessages(room2, ["Thread1", "Thread2", threadedOff("Thread1", "t1a")]);
// Make sure the message in Thread 1 has definitely arrived, so that we know for sure
// that the one in Thread 2 is the latest.
assertUnread(room2, 3);
receiveMessages(room2, [threadedOff("Thread2", "t2a")]);
// Make sure the 4th message has arrived before we mark as read.
assertUnread(room2, 4);
// When I mark the room as read (making an unthreaded receipt for t2a)
markAsRead(room2);