Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Commit

Permalink
Assert that the thread is unread after an edit
Browse files Browse the repository at this point in the history
  • Loading branch information
andybalaam committed Aug 31, 2023
1 parent 6e6493d commit f9297b0
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion cypress/e2e/read-receipts/high-level.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(() => {
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit f9297b0

Please sign in to comment.