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

Commit 281916f

Browse files
authored
Take the Threads Activity Centre out of labs (#12439)
* Take the TAC out of labs! Requires #12438 and ideally #12418 * i18n * Add test method That's needed now we we don't include threads in the notif count in the tests * One less labs setting * Update snapshot * Disable release announcement * Unused import * Fix some screenshots * Fix all the unread test cases now room unreads don't include threads * Fix more tests * Even more test fixes * Still more test fixes * Oh goodness, it's more test fixes * Fix selectors now there are 2 buttons called Threads * Disable some tests that aren't passing for reasons that don't appear releated to any of the TAC work, as per the comment. * Remove debugging * Oops, removed too much
1 parent 02e7fb3 commit 281916f

File tree

20 files changed

+338
-197
lines changed

20 files changed

+338
-197
lines changed

playwright/e2e/read-receipts/editing-messages.spec.ts

+29-12
Original file line numberDiff line numberDiff line change
@@ -187,11 +187,11 @@ test.describe("Read receipts", () => {
187187
// Given we have read the thread
188188
await util.goTo(room1);
189189
await util.receiveMessages(room2, ["Msg1", msg.threadedOff("Msg1", "Resp1")]);
190-
await util.assertUnread(room2, 2);
190+
await util.assertUnread(room2, 1);
191191
await util.goTo(room2);
192192
await util.openThread("Msg1");
193193
await util.assertRead(room2);
194-
await util.backToThreadsList();
194+
await util.assertReadThread("Resp1");
195195
await util.goTo(room1);
196196

197197
// When a message inside it is edited
@@ -202,6 +202,7 @@ test.describe("Read receipts", () => {
202202
await util.goTo(room2);
203203
await util.assertReadThread("Msg1");
204204
});
205+
205206
test("Reading an edit of a threaded message makes the room read", async ({
206207
roomAlpha: room1,
207208
roomBeta: room2,
@@ -211,11 +212,11 @@ test.describe("Read receipts", () => {
211212
// Given an edited thread message appears after we read it
212213
await util.goTo(room1);
213214
await util.receiveMessages(room2, ["Msg1", msg.threadedOff("Msg1", "Resp1")]);
214-
await util.assertUnread(room2, 2);
215+
await util.assertUnread(room2, 1);
215216
await util.goTo(room2);
216217
await util.openThread("Msg1");
217218
await util.assertRead(room2);
218-
await util.backToThreadsList();
219+
await util.assertReadThread("Resp1");
219220
await util.goTo(room1);
220221
await util.receiveMessages(room2, [msg.editOf("Resp1", "Edit1")]);
221222
await util.assertStillRead(room2);
@@ -228,6 +229,7 @@ test.describe("Read receipts", () => {
228229
await util.assertStillRead(room2);
229230
await util.assertReadThread("Msg1");
230231
});
232+
231233
test("Marking a room as read after an edit in a thread makes it read", async ({
232234
roomAlpha: room1,
233235
roomBeta: room2,
@@ -241,14 +243,16 @@ test.describe("Read receipts", () => {
241243
msg.threadedOff("Msg1", "Resp1"),
242244
msg.editOf("Resp1", "Edit1"),
243245
]);
244-
await util.assertUnread(room2, 2);
246+
await util.assertUnread(room2, 1);
245247

246248
// When I mark the room as read
247249
await util.markAsRead(room2);
248250

249251
// Then it is read
250252
await util.assertRead(room2);
253+
await util.assertReadThread("Msg1");
251254
});
255+
252256
test("Editing a thread message after marking as read leaves the room read", async ({
253257
roomAlpha: room1,
254258
roomBeta: room2,
@@ -258,7 +262,7 @@ test.describe("Read receipts", () => {
258262
// Given a room is marked as read
259263
await util.goTo(room1);
260264
await util.receiveMessages(room2, ["Msg1", msg.threadedOff("Msg1", "Resp1")]);
261-
await util.assertUnread(room2, 2);
265+
await util.assertUnread(room2, 1);
262266
await util.markAsRead(room2);
263267
await util.assertRead(room2);
264268

@@ -267,7 +271,9 @@ test.describe("Read receipts", () => {
267271

268272
// Then the room remains read
269273
await util.assertStillRead(room2);
274+
await util.assertReadThread("Msg1");
270275
});
276+
271277
test("A room with an edited threaded message is still read after restart", async ({
272278
roomAlpha: room1,
273279
roomBeta: room2,
@@ -287,6 +293,7 @@ test.describe("Read receipts", () => {
287293
// Then is it still read
288294
await util.assertRead(room2);
289295
});
296+
290297
test("A room where all threaded edits are read is still read after restart", async ({
291298
roomAlpha: room1,
292299
roomBeta: room2,
@@ -295,20 +302,23 @@ test.describe("Read receipts", () => {
295302
}) => {
296303
await util.goTo(room1);
297304
await util.receiveMessages(room2, ["Msg1", msg.threadedOff("Msg1", "Resp1")]);
298-
await util.assertUnread(room2, 2);
305+
await util.assertUnread(room2, 1);
299306
await util.receiveMessages(room2, [msg.editOf("Resp1", "Edit1")]);
300-
await util.assertUnread(room2, 2);
307+
await util.assertUnread(room2, 1);
301308

302309
await util.goTo(room2);
303310

304311
await util.openThread("Msg1");
305312
await util.assertRead(room2);
313+
await util.assertReadThread("Msg1");
306314
await util.goTo(room1); // Make sure we are looking at room1 after reload
307315
await util.assertStillRead(room2);
308316

309317
await util.saveAndReload();
310318
await util.assertRead(room2);
319+
await util.assertReadThread("Msg1");
311320
});
321+
312322
test("A room where all threaded edits are marked as read is still read after restart", async ({
313323
roomAlpha: room1,
314324
roomBeta: room2,
@@ -321,15 +331,17 @@ test.describe("Read receipts", () => {
321331
msg.threadedOff("Msg1", "Resp1"),
322332
msg.editOf("Resp1", "Edit1"),
323333
]);
324-
await util.assertUnread(room2, 2);
334+
await util.assertUnread(room2, 1);
325335
await util.markAsRead(room2);
326336
await util.assertRead(room2);
337+
await util.assertReadThread("Msg1");
327338

328339
// When I restart
329340
await util.saveAndReload();
330341

331342
// It is still read
332343
await util.assertRead(room2);
344+
await util.assertReadThread("Msg1");
333345
});
334346
});
335347

@@ -343,7 +355,7 @@ test.describe("Read receipts", () => {
343355
// Given I have read a thread
344356
await util.goTo(room1);
345357
await util.receiveMessages(room2, ["Msg1", msg.threadedOff("Msg1", "Resp1")]);
346-
await util.assertUnread(room2, 2);
358+
await util.assertUnread(room2, 1);
347359
await util.goTo(room2);
348360
await util.openThread("Msg1");
349361
await util.backToThreadsList();
@@ -361,6 +373,7 @@ test.describe("Read receipts", () => {
361373
await util.assertStillRead(room2);
362374
await util.assertReadThread("Edit1");
363375
});
376+
364377
test("Reading an edit of a thread root leaves the room read", async ({
365378
roomAlpha: room1,
366379
roomBeta: room2,
@@ -386,6 +399,7 @@ test.describe("Read receipts", () => {
386399
await util.goTo(room1);
387400
await util.assertStillRead(room2);
388401
});
402+
389403
test("Editing a thread root after reading leaves the room read", async ({
390404
roomAlpha: room1,
391405
roomBeta: room2,
@@ -405,6 +419,7 @@ test.describe("Read receipts", () => {
405419
// Then the room stays read
406420
await util.assertStillRead(room2);
407421
});
422+
408423
test("Marking a room as read after an edit of a thread root keeps it read", async ({
409424
roomAlpha: room1,
410425
roomBeta: room2,
@@ -431,6 +446,7 @@ test.describe("Read receipts", () => {
431446
await util.goTo(room1);
432447
await util.assertStillRead(room2);
433448
});
449+
434450
test("Editing a thread root that is a reply after marking as read leaves the room read", async ({
435451
roomAlpha: room1,
436452
roomBeta: room2,
@@ -444,7 +460,7 @@ test.describe("Read receipts", () => {
444460
msg.replyTo("Msg", "Reply"),
445461
msg.threadedOff("Reply", "InThread"),
446462
]);
447-
await util.assertUnread(room2, 3);
463+
await util.assertUnread(room2, 2);
448464
await util.markAsRead(room2);
449465
await util.assertRead(room2);
450466

@@ -458,6 +474,7 @@ test.describe("Read receipts", () => {
458474
await util.goTo(room2);
459475
await util.assertReadThread("Edited Reply");
460476
});
477+
461478
test("Marking a room as read after an edit of a thread root that is a reply leaves it read", async ({
462479
roomAlpha: room1,
463480
roomBeta: room2,
@@ -472,7 +489,7 @@ test.describe("Read receipts", () => {
472489
msg.threadedOff("Reply", "InThread"),
473490
]);
474491
await util.receiveMessages(room2, [msg.editOf("Reply", "Edited Reply")]);
475-
await util.assertUnread(room2, 3);
492+
await util.assertUnread(room2, 2);
476493

477494
// When I mark the room as read
478495
await util.markAsRead(room2);

playwright/e2e/read-receipts/high-level.spec.ts

+17-14
Original file line numberDiff line numberDiff line change
@@ -224,15 +224,15 @@ test.describe("Read receipts", () => {
224224
...msg.manyThreadedOff("Root3", many("T", 20)),
225225
]);
226226
await util.goTo(room2);
227-
await util.assertUnread(room2, 60);
227+
await util.assertRead(room2);
228+
await util.assertUnreadThread("Root1");
229+
await util.assertUnreadThread("Root2");
230+
await util.assertUnreadThread("Root3");
228231
await util.openThread("Root1");
229-
await util.assertUnread(room2, 40);
230232
await util.assertReadThread("Root1");
231233
await util.openThread("Root2");
232-
await util.assertUnread(room2, 20);
233234
await util.assertReadThread("Root2");
234235
await util.openThread("Root3");
235-
await util.assertRead(room2);
236236
await util.assertReadThread("Root3");
237237

238238
// When I restart and page up to load old thread roots
@@ -247,6 +247,7 @@ test.describe("Read receipts", () => {
247247
await util.assertReadThread("Root2");
248248
await util.assertReadThread("Root3");
249249
});
250+
250251
test("Paging up to find old threads that were never read keeps the room unread", async ({
251252
cryptoBackend,
252253
roomAlpha: room1,
@@ -268,7 +269,7 @@ test.describe("Read receipts", () => {
268269
...many("Msg", 100),
269270
]);
270271
await util.goTo(room2);
271-
await util.assertUnread(room2, 6);
272+
await util.assertRead(room2);
272273
await util.assertUnreadThread("Root1");
273274
await util.assertUnreadThread("Root2");
274275
await util.assertUnreadThread("Root3");
@@ -278,20 +279,21 @@ test.describe("Read receipts", () => {
278279
await util.goTo(room1);
279280
await util.saveAndReload();
280281

281-
// Then the room remembers it's unread
282+
// Then the room remembers it's read
282283
// TODO: I (andyb) think this will fall in an encrypted room
283-
await util.assertUnread(room2, 6);
284+
await util.assertRead(room2);
284285

285286
// And when I page up to load old thread roots
286287
await util.goTo(room2);
287288
await util.pageUp();
288289

289-
// Then the room remains unread
290-
await util.assertUnread(room2, 6);
290+
// Then the room remains read
291+
await util.assertRead(room2);
291292
await util.assertUnreadThread("Root1");
292293
await util.assertUnreadThread("Root2");
293294
await util.assertUnreadThread("Root3");
294295
});
296+
295297
test("Looking in thread view to find old threads that were never read makes the room unread", async ({
296298
roomAlpha: room1,
297299
roomBeta: room2,
@@ -310,7 +312,7 @@ test.describe("Read receipts", () => {
310312
...many("Msg", 100),
311313
]);
312314
await util.goTo(room2);
313-
await util.assertUnread(room2, 6);
315+
await util.assertRead(room2);
314316
await util.assertUnreadThread("Root1");
315317
await util.assertUnreadThread("Root2");
316318
await util.assertUnreadThread("Root3");
@@ -320,20 +322,21 @@ test.describe("Read receipts", () => {
320322
await util.goTo(room1);
321323
await util.saveAndReload();
322324

323-
// Then the room remembers it's unread
325+
// Then the room remembers it's read
324326
// TODO: I (andyb) think this will fall in an encrypted room
325-
await util.assertUnread(room2, 6);
327+
await util.assertRead(room2);
326328

327329
// And when I open the threads view
328330
await util.goTo(room2);
329331
await util.openThreadList();
330332

331-
// Then the room remains unread
332-
await util.assertUnread(room2, 6);
333+
// Then the room remains read
334+
await util.assertRead(room2);
333335
await util.assertUnreadThread("Root1");
334336
await util.assertUnreadThread("Root2");
335337
await util.assertUnreadThread("Root3");
336338
});
339+
337340
test("After marking room as read, paging up to find old threads that were never read leaves the room read", async ({
338341
cryptoBackend,
339342
roomAlpha: room1,

0 commit comments

Comments
 (0)