From 75e4f2fe1b94c1a44eb4f76f611ad256d4baff97 Mon Sep 17 00:00:00 2001 From: Andy Balaam Date: Thu, 31 Aug 2023 17:04:28 +0100 Subject: [PATCH] More assertions about threads being read --- cypress/e2e/read-receipts/high-level.spec.ts | 21 +++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/cypress/e2e/read-receipts/high-level.spec.ts b/cypress/e2e/read-receipts/high-level.spec.ts index ccbcb2d34c7c..7144b6994ba2 100644 --- a/cypress/e2e/read-receipts/high-level.spec.ts +++ b/cypress/e2e/read-receipts/high-level.spec.ts @@ -880,18 +880,21 @@ describe("Read receipts", () => { goTo(room1); receiveMessages(room2, ["Msg1", threadedOff("Msg1", "Resp1")]); assertUnread(room2, 2); - goTo(room2); openThread("Msg1"); assertRead(room2); + backToThreadsList(); goTo(room1); - receiveMessages(room2, [editOf("Resp1", "Edit1")]); assertUnread(room2, 1); + // When I read it goTo(room2); openThread("Msg1"); + + // Then the room and thread are read assertRead(room2); + assertReadThread("Msg1"); }); // XXX: fails because the room is still "bold" even though the notification counts all disappear it.skip("Marking a room as read after an edit in a thread makes it read", () => { @@ -944,19 +947,27 @@ describe("Read receipts", () => { }); describe("thread roots", () => { - // XXX: fails because on CI we get a dot, but locally we get a count. Must be a timing issue. - it.skip("An edit of a thread root makes the room unread", () => { + it("An edit of a thread root makes the room unread", () => { + // Given I have read a thread goTo(room1); receiveMessages(room2, ["Msg1", threadedOff("Msg1", "Resp1")]); assertUnread(room2, 2); - goTo(room2); openThread("Msg1"); + backToThreadsList(); assertRead(room2); goTo(room1); + // When the thread root is edited receiveMessages(room2, [editOf("Msg1", "Edit1")]); + + // Then the room is unread assertUnread(room2, 1); + + // But the thread is read + goTo(room2); + assertRead(room2); + assertReadThread("Edit1"); }); it.skip("Reading an edit of a thread root makes the room read", () => { // Given a fully-read thread exists