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

Commit

Permalink
Fix more tests in redactions.spec.ts (#12026)
Browse files Browse the repository at this point in the history
  • Loading branch information
florianduros authored Dec 12, 2023
1 parent 0d617db commit 2002f3f
Showing 1 changed file with 15 additions and 18 deletions.
33 changes: 15 additions & 18 deletions playwright/e2e/read-receipts/redactions.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -329,8 +329,7 @@ test.describe("Read receipts", () => {
});

test.describe("in threads", () => {
// XXX: fails because it flakes saying the room is unread when it should be read
test.skip("Redacting the threaded message pointed to by my receipt leaves the room read", async ({
test("Redacting the threaded message pointed to by my receipt leaves the room read", async ({
roomAlpha: room1,
roomBeta: room2,
util,
Expand All @@ -339,18 +338,18 @@ test.describe("Read receipts", () => {
// Given I have some threads
await util.goTo(room1);
await util.receiveMessages(room2, [
"Root",
msg.threadedOff("Root", "ThreadMsg1"),
msg.threadedOff("Root", "ThreadMsg2"),
"Root1",
msg.threadedOff("Root1", "ThreadMsg1"),
msg.threadedOff("Root1", "ThreadMsg2"),
"Root2",
msg.threadedOff("Root2", "Root2->A"),
]);
await util.assertUnread(room2, 5);

// And I have read them
await util.goTo(room2);
await util.assertUnreadThread("Root");
await util.openThread("Root");
await util.assertUnreadThread("Root1");
await util.openThread("Root1");
await util.assertUnreadLessThan(room2, 4);
await util.openThread("Root2");
await util.assertRead(room2);
Expand All @@ -364,7 +363,7 @@ test.describe("Read receipts", () => {
// Then the room and thread are still read
await util.assertStillRead(room2);
await util.goTo(room2);
await util.assertReadThread("Root");
await util.assertReadThread("Root1");
});
test("Reading an unread thread after a redaction of the latest message makes it read", async ({
roomAlpha: room1,
Expand Down Expand Up @@ -536,8 +535,7 @@ test.describe("Read receipts", () => {
await util.goTo(room2);
await util.assertReadThread("Root");
});
// XXX: fails because it flakes - sometimes the room is still unread after opening the thread (initially)
test.skip("Reacting to a redacted message leaves the thread read", async ({
test("Reacting to a redacted message leaves the thread read", async ({
roomAlpha: room1,
roomBeta: room2,
util,
Expand Down Expand Up @@ -726,8 +724,7 @@ test.describe("Read receipts", () => {
await util.goTo(room2);
await util.assertReadThread("Root");
});
// XXX: fails because it flakes
test.skip("A thread with a read redaction is still read after restart", async ({
test("A thread with a read redaction is still read after restart", async ({
roomAlpha: room1,
roomBeta: room2,
util,
Expand All @@ -736,16 +733,16 @@ test.describe("Read receipts", () => {
// Given my receipt points at a redacted thread message
await util.goTo(room1);
await util.receiveMessages(room2, [
"Root",
msg.threadedOff("Root", "ThreadMsg1"),
msg.threadedOff("Root", "ThreadMsg2"),
"Root1",
msg.threadedOff("Root1", "ThreadMsg1"),
msg.threadedOff("Root1", "ThreadMsg2"),
"Root2",
msg.threadedOff("Root2", "Root2->A"),
]);
await util.assertUnread(room2, 5);
await util.goTo(room2);
await util.assertUnreadThread("Root");
await util.openThread("Root");
await util.assertUnreadThread("Root1");
await util.openThread("Root1");
await util.assertUnreadLessThan(room2, 4);
await util.openThread("Root2");
await util.assertRead(room2);
Expand All @@ -755,7 +752,7 @@ test.describe("Read receipts", () => {
await util.receiveMessages(room2, [msg.redactionOf("ThreadMsg2")]);
await util.assertStillRead(room2);
await util.goTo(room2);
await util.assertReadThread("Root");
await util.assertReadThread("Root1");

// When I restart
await util.saveAndReload();
Expand Down

0 comments on commit 2002f3f

Please sign in to comment.