From 1f06d97ffe75a9cfdb5ffcc17e2eef4aa210ad62 Mon Sep 17 00:00:00 2001 From: Richard van der Hoff <1389908+richvdh@users.noreply.github.com> Date: Fri, 1 Dec 2023 11:11:14 +0000 Subject: [PATCH] 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 --- cypress/e2e/read-receipts/new-messages.spec.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cypress/e2e/read-receipts/new-messages.spec.ts b/cypress/e2e/read-receipts/new-messages.spec.ts index 1cd625811f..74ddd18199 100644 --- a/cypress/e2e/read-receipts/new-messages.spec.ts +++ b/cypress/e2e/read-receipts/new-messages.spec.ts @@ -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);