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

Fix threaded reply playwright tests #12070

Merged
merged 1 commit into from
Dec 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions playwright/e2e/read-receipts/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -155,10 +155,19 @@ export class MessageBuilder {
public async getContent(room: JSHandle<Room>): Promise<Record<string, unknown>> {
const ev = await this.messageFinder.getMessage(room, targetMessage, true);
return ev.evaluate((ev, newMessage) => {
const threadRel =
ev.getRelation()?.rel_type === "m.thread"
? {
rel_type: "m.thread",
event_id: ev.getRelation().event_id,
}
: {};

return {
"msgtype": "m.text",
"body": newMessage,
"m.relates_to": {
...threadRel,
"m.in_reply_to": {
event_id: ev.getId(),
},
Expand Down
9 changes: 3 additions & 6 deletions playwright/e2e/read-receipts/redactions.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -642,8 +642,7 @@ test.describe("Read receipts", () => {
await util.assertRead(room2);
await util.assertReadThread("Root");
});
// XXX: fails because the read count drops to 1 but not to zero (this is a genuine stuck unread case)
test.skip("Reading a reply to a redacted message marks the thread as read", async ({
test("Reading a reply to a redacted message marks the thread as read", async ({
roomAlpha: room1,
roomBeta: room2,
util,
Expand Down Expand Up @@ -760,8 +759,7 @@ test.describe("Read receipts", () => {
// Then the room is still read
await util.assertRead(room2);
});
// XXX: fails for the same reason as "Reading a reply to a redacted message marks the thread as read"
test.skip("A thread with an unread reply to a redacted message is still unread after restart", async ({
test("A thread with an unread reply to a redacted message is still unread after restart", async ({
roomAlpha: room1,
roomBeta: room2,
util,
Expand Down Expand Up @@ -791,8 +789,7 @@ test.describe("Read receipts", () => {
await util.assertRead(room2);
await util.assertReadThread("Root");
});
// XXX: fails for the same reason as "Reading a reply to a redacted message marks the thread as read
test.skip("A thread with a read reply to a redacted message is still read after restart", async ({
test("A thread with a read reply to a redacted message is still read after restart", async ({
roomAlpha: room1,
roomBeta: room2,
util,
Expand Down
Loading