Merge branch 'develop' into andybalaam/fix-receipt-flakes
This commit is contained in:
commit
8565637213
2 changed files with 19 additions and 15 deletions
|
@ -263,21 +263,17 @@ describe("Read receipts", () => {
|
||||||
assertRead(room2);
|
assertRead(room2);
|
||||||
});
|
});
|
||||||
it("A room where all edits are read is still read after restart", () => {
|
it("A room where all edits are read is still read after restart", () => {
|
||||||
// Given an edit made the room unread
|
// Given a message was edited and read
|
||||||
goTo(room2);
|
goTo(room1);
|
||||||
receiveMessages(room2, ["Msg1"]);
|
receiveMessages(room2, ["Msg1", editOf("Msg1", "Msg1 Edit1")]);
|
||||||
assertRead(room2);
|
|
||||||
receiveMessages(room2, [editOf("Msg1", "Msg1 Edit1")]);
|
|
||||||
assertUnread(room2, 1);
|
assertUnread(room2, 1);
|
||||||
|
goTo(room2);
|
||||||
// When I mark it as read
|
|
||||||
markAsRead(room2);
|
|
||||||
|
|
||||||
// Then the room becomes read
|
|
||||||
assertRead(room2);
|
assertRead(room2);
|
||||||
|
|
||||||
// And remains so after a reload
|
// When I reload
|
||||||
saveAndReload();
|
saveAndReload();
|
||||||
|
|
||||||
|
// Then the room is still read
|
||||||
assertRead(room2);
|
assertRead(room2);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -371,7 +367,7 @@ describe("Read receipts", () => {
|
||||||
it("A room where all threaded edits are read is still read after restart", () => {
|
it("A room where all threaded edits are read is still read after restart", () => {
|
||||||
goTo(room2);
|
goTo(room2);
|
||||||
receiveMessages(room2, ["Msg1", threadedOff("Msg1", "Resp1"), editOf("Resp1", "Edit1")]);
|
receiveMessages(room2, ["Msg1", threadedOff("Msg1", "Resp1"), editOf("Resp1", "Edit1")]);
|
||||||
assertUnread(room2, 2);
|
assertUnread(room2, 1);
|
||||||
openThread("Msg1");
|
openThread("Msg1");
|
||||||
assertRead(room2);
|
assertRead(room2);
|
||||||
goTo(room1); // Make sure we are looking at room1 after reload
|
goTo(room1); // Make sure we are looking at room1 after reload
|
||||||
|
|
|
@ -22,6 +22,7 @@ import type { MatrixClient, MatrixEvent } from "matrix-js-sdk/src/matrix";
|
||||||
import { HomeserverInstance } from "../../plugins/utils/homeserver";
|
import { HomeserverInstance } from "../../plugins/utils/homeserver";
|
||||||
import {
|
import {
|
||||||
assertRead,
|
assertRead,
|
||||||
|
assertStillRead,
|
||||||
assertUnread,
|
assertUnread,
|
||||||
customEvent,
|
customEvent,
|
||||||
goTo,
|
goTo,
|
||||||
|
@ -157,18 +158,25 @@ describe("Read receipts", () => {
|
||||||
assertRead(room2);
|
assertRead(room2);
|
||||||
});
|
});
|
||||||
it("Sending an important event after unimportant ones makes the room unread", () => {
|
it("Sending an important event after unimportant ones makes the room unread", () => {
|
||||||
|
// Given We have read the important messages
|
||||||
goTo(room1);
|
goTo(room1);
|
||||||
assertRead(room2);
|
assertRead(room2);
|
||||||
receiveMessages(room2, ["Msg1", "Msg2"]);
|
receiveMessages(room2, ["Msg1", "Msg2"]);
|
||||||
assertUnread(room2, 2);
|
assertUnread(room2, 2);
|
||||||
|
goTo(room2);
|
||||||
markAsRead(room2);
|
|
||||||
assertRead(room2);
|
assertRead(room2);
|
||||||
|
goTo(room1);
|
||||||
|
|
||||||
|
// When we receive important messages
|
||||||
receiveMessages(room2, [customEvent("org.custom.event", { body: "foobar" })]);
|
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"]);
|
receiveMessages(room2, ["Hello"]);
|
||||||
|
|
||||||
|
// The room is unread again
|
||||||
assertUnread(room2, 1);
|
assertUnread(room2, 1);
|
||||||
});
|
});
|
||||||
it.skip("A receipt for the last unimportant event makes the room read, even if all are unimportant", () => {});
|
it.skip("A receipt for the last unimportant event makes the room read, even if all are unimportant", () => {});
|
||||||
|
|
Loading…
Reference in a new issue