From f9297b06fea69c8b42529e5d6baaf99da768dec0 Mon Sep 17 00:00:00 2001 From: Andy Balaam Date: Thu, 31 Aug 2023 16:59:07 +0100 Subject: [PATCH] Assert that the thread is unread after an edit --- cypress/e2e/read-receipts/high-level.spec.ts | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/cypress/e2e/read-receipts/high-level.spec.ts b/cypress/e2e/read-receipts/high-level.spec.ts index 5f21c4fa28b..77ae7cf0cdd 100644 --- a/cypress/e2e/read-receipts/high-level.spec.ts +++ b/cypress/e2e/read-receipts/high-level.spec.ts @@ -103,6 +103,11 @@ describe("Read receipts", () => { }); } + function backToThreadsList() { + cy.log("Back to threads list"); + cy.get(".mx_RightPanel").findByTitle("Threads").click(); + } + function openThread(rootMessage: string) { cy.log("Open thread", rootMessage); cy.get(".mx_RoomView_body", { log: false }).within(() => { @@ -838,17 +843,23 @@ describe("Read receipts", () => { describe("in threads", () => { it("An edit of a threaded message makes the room unread", () => { + // Given we have read the thread goTo(room1); receiveMessages(room2, ["Msg1", threadedOff("Msg1", "Resp1")]); assertUnread(room2, 2); - goTo(room2); openThread("Msg1"); assertRead(room2); + backToThreadsList(); goTo(room1); + // When a message inside it is edited receiveMessages(room2, [editOf("Resp1", "Edit1")]); + + // Then the room and thread are unread assertUnread(room2, 1); + goTo(room2); + assertUnreadThread("Msg1"); }); it("Reading an edit of a threaded message makes the room read", () => { goTo(room1);