Add tests about room list order (#12088)

This commit is contained in:
Florian Duros 2023-12-29 11:06:51 +01:00 committed by GitHub
parent b3fec2a0d9
commit f6fc91196f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 68 additions and 1 deletions

View file

@ -415,7 +415,43 @@ test.describe("Read receipts", () => {
});
test.describe("Room list order", () => {
test.fixme("Rooms with unread threads appear at the top of room list if 'unread first' is selected", () => {});
test("Rooms with unread messages appear at the top of room list if 'unread first' is selected", async ({
roomAlpha: room1,
roomBeta: room2,
util,
msg,
page,
}) => {
await util.goTo(room2);
// Display the unread first room
await util.toggleRoomUnreadOrder();
await util.receiveMessages(room1, ["Msg1"]);
await page.reload();
// Room 1 has an unread message and should be displayed first
await util.assertRoomListOrder([room1, room2]);
});
test("Rooms with unread threads appear at the top of room list if 'unread first' is selected", async ({
roomAlpha: room1,
roomBeta: room2,
util,
msg,
}) => {
await util.goTo(room2);
await util.receiveMessages(room1, ["Msg1"]);
await util.markAsRead(room1);
await util.assertRead(room1);
// Display the unread first room
await util.toggleRoomUnreadOrder();
await util.receiveMessages(room1, [msg.threadedOff("Msg1", "Resp1")]);
await util.saveAndReload();
// Room 1 has an unread message and should be displayed first
await util.assertRoomListOrder([room1, room2]);
});
});
test.describe("Notifications", () => {