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

Commit 537b4a1

Browse files
floriandurosdbkr
andauthored
Playwright: Fix thread root skipped tests (#12067)
* Fix thread root skipped tests * Add comment about collapsed content in `redactions.spec.ts` --------- Co-authored-by: David Baker <dbkr@users.noreply.github.com>
1 parent 4c2efc3 commit 537b4a1

File tree

2 files changed

+15
-6
lines changed

2 files changed

+15
-6
lines changed

playwright/e2e/read-receipts/index.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -370,6 +370,15 @@ class Helpers {
370370
await this.app.viewRoomByName(typeof room === "string" ? room : room.name);
371371
}
372372

373+
/**
374+
* Expand the message with the supplied index in the timeline.
375+
* @param index
376+
*/
377+
async openCollapsedMessage(index: number) {
378+
const button = this.page.locator(".mx_GenericEventListSummary_toggle");
379+
await button.nth(index).click();
380+
}
381+
373382
/**
374383
* Click the thread with the supplied content in the thread root to open it in
375384
* the Threads panel.

playwright/e2e/read-receipts/redactions.spec.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -849,8 +849,7 @@ test.describe("Read receipts", () => {
849849
// Then the room is still read
850850
await util.assertStillRead(room2);
851851
});
852-
// TODO: Can't open a thread on a redacted thread root
853-
test.skip("Redacting a thread root still allows us to read the thread", async ({
852+
test("Redacting a thread root still allows us to read the thread", async ({
854853
roomAlpha: room1,
855854
roomBeta: room2,
856855
util,
@@ -874,12 +873,13 @@ test.describe("Read receipts", () => {
874873
// And I can open the thread and read it
875874
await util.goTo(room2);
876875
await util.assertUnread(room2, 2);
877-
await util.openThread("Root");
876+
// The redacted message gets collapsed into, "foo was invited, joined and removed a message"
877+
await util.openCollapsedMessage(1);
878+
await util.openThread("Message deleted");
878879
await util.assertRead(room2);
879880
await util.assertReadThread("Root");
880881
});
881-
// TODO: Can't open a thread on a redacted thread root
882-
test.skip("Sending a threaded message onto a redacted thread root leaves the room unread", async ({
882+
test("Sending a threaded message onto a redacted thread root leaves the room unread", async ({
883883
roomAlpha: room1,
884884
roomBeta: room2,
885885
util,
@@ -905,7 +905,7 @@ test.describe("Read receipts", () => {
905905
// Then the room and thread are unread
906906
await util.assertUnread(room2, 1);
907907
await util.goTo(room2);
908-
await util.assertUnreadThread("Root");
908+
await util.assertUnreadThread("Message deleted");
909909
});
910910
test("Reacting to a redacted thread root leaves the room read", async ({
911911
roomAlpha: room1,

0 commit comments

Comments
 (0)