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 Sep 6, 2023
1 parent 8c42c63 commit 2bd1b62
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions 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 @@ -851,19 +856,24 @@ describe("Read receipts", () => {
});

describe("in threads", () => {
// 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 threaded message makes the room unread", () => {
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");
});
// XXX: fails because on CI we get a dot, but locally we get a count. Must be a timing issue.
it.skip("Reading an edit of a threaded message makes the room read", () => {
Expand Down

0 comments on commit 2bd1b62

Please sign in to comment.