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

Commit

Permalink
Merge pull request #11652 from matrix-org/andybalaam/fix-flake-in-edi…
Browse files Browse the repository at this point in the history
…ting-test

Fix flaky tests around editing messages
  • Loading branch information
andybalaam committed Sep 25, 2023
2 parents 0f59298 + 25a462a commit 5901920
Showing 1 changed file with 8 additions and 12 deletions.
20 changes: 8 additions & 12 deletions cypress/e2e/read-receipts/editing-messages.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -263,21 +263,17 @@ describe("Read receipts", () => {
assertRead(room2);
});
it("A room where all edits are read is still read after restart", () => {
// Given an edit made the room unread
goTo(room2);
receiveMessages(room2, ["Msg1"]);
assertRead(room2);
receiveMessages(room2, [editOf("Msg1", "Msg1 Edit1")]);
// Given a message was edited and read
goTo(room1);
receiveMessages(room2, ["Msg1", editOf("Msg1", "Msg1 Edit1")]);
assertUnread(room2, 1);

// When I mark it as read
markAsRead(room2);

// Then the room becomes read
goTo(room2);
assertRead(room2);

// And remains so after a reload
// When I reload
saveAndReload();

// Then the room is still read
assertRead(room2);
});
});
Expand Down Expand Up @@ -371,7 +367,7 @@ describe("Read receipts", () => {
it("A room where all threaded edits are read is still read after restart", () => {
goTo(room2);
receiveMessages(room2, ["Msg1", threadedOff("Msg1", "Resp1"), editOf("Resp1", "Edit1")]);
assertUnread(room2, 2);
assertUnread(room2, 1);
openThread("Msg1");
assertRead(room2);
goTo(room1); // Make sure we are looking at room1 after reload
Expand Down

0 comments on commit 5901920

Please sign in to comment.