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 #11654 from matrix-org/andybalaam/fix-high-level-f…
Browse files Browse the repository at this point in the history
…lakes

Fix flake in high-level tests by not using markAsRead
  • Loading branch information
andybalaam committed Sep 25, 2023
2 parents 5901920 + 4097844 commit de250df
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions cypress/e2e/read-receipts/high-level.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import type { MatrixClient, MatrixEvent } from "matrix-js-sdk/src/matrix";
import { HomeserverInstance } from "../../plugins/utils/homeserver";
import {
assertRead,
assertStillRead,
assertUnread,
customEvent,
goTo,
Expand Down Expand Up @@ -157,18 +158,25 @@ describe("Read receipts", () => {
assertRead(room2);
});
it("Sending an important event after unimportant ones makes the room unread", () => {
// Given We have read the important messages
goTo(room1);
assertRead(room2);
receiveMessages(room2, ["Msg1", "Msg2"]);
assertUnread(room2, 2);

markAsRead(room2);
goTo(room2);
assertRead(room2);
goTo(room1);

// When we receive important messages
receiveMessages(room2, [customEvent("org.custom.event", { body: "foobar" })]);
assertRead(room2);

// Then the room is still read
assertStillRead(room2);

// And when we receive more important ones
receiveMessages(room2, ["Hello"]);

// The room is unread again
assertUnread(room2, 1);
});
it.skip("A receipt for the last unimportant event makes the room read, even if all are unimportant", () => {});
Expand Down

0 comments on commit de250df

Please sign in to comment.