* Default to new room list and enforce in config for app and develop * Update jest tests * Update LandmarkNavigation and e2e test * Update viewRoomByName helper * lint * Update Add -> New Room flow Keep legacy viewRoomByName until we delete the olds tests. * Update e2e test to use Add -> Start Chat * Update screenshots * Fix viewRoomByName, can't use option as it contains more that just the room name. Using title which should be exact. * Fix knocking tests * fix layout.spec.ts and pstn.spec * timeline snapshots * Fix spotlight.spec * TAC spaces and media preview settings * Fix more screenshots and mark as unread tests * Fix leftpanel test * Bugfix for knocking use case. We should check EffectiveMembership when remove rooms from the new room list, so that knocking is handled * Fix openCreateRoomDialog to new room list specifics to fix create-knock-room.spec.ts * lint * Fix Landmark navigation from left panel search to the next landmark * lint * Update window-12px-linux.png * Update apps-drawer-linux.png * Update sliding sync e2e tests * Update some screenshots * Revert change to the space create screenshot * Use actual screenshot as focused elements are different when generated locally * Fix test selectors * Morfe test screenshot selector / update * Add test for landmark navigation * Replace screenshots * Fix another test that just got added an hour ago * Not sure why this was changed, doesn't seem necessary * Disambiguate selector * Another screenshot that's now changed in width by 1px * Revert changes to config files It's being turned on by default so these are unnecessary * Convert read.unread assertions to new room list removing support for checking for activity in assertUnread which was unused. * Update room list order tests that feel a bit like they ought to be in room-list rather than read-receipts but whatever * Fix room titles in read receipts test --------- Co-authored-by: David Baker <dbkr@users.noreply.github.com>
60 lines
2.2 KiB
TypeScript
60 lines
2.2 KiB
TypeScript
/*
|
|
Copyright 2024 New Vector Ltd.
|
|
Copyright 2024 The Matrix.org Foundation C.I.C.
|
|
|
|
SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Commercial
|
|
Please see LICENSE files in the repository root for full details.
|
|
*/
|
|
|
|
import { test, expect } from "../../element-web-test";
|
|
import { isDendrite } from "../../plugins/homeserver/dendrite";
|
|
|
|
const TEST_ROOM_NAME = "The mark unread test room";
|
|
|
|
test.describe("Mark as Unread", () => {
|
|
test.skip(isDendrite, "due to Dendrite bug https://github.com/element-hq/dendrite/issues/2970");
|
|
|
|
test.use({
|
|
displayName: "Tom",
|
|
botCreateOpts: {
|
|
displayName: "BotBob",
|
|
autoAcceptInvites: true,
|
|
},
|
|
});
|
|
|
|
test("should mark a room as unread", async ({ page, app, bot }) => {
|
|
const roomId = await app.client.createRoom({
|
|
name: TEST_ROOM_NAME,
|
|
});
|
|
const dummyRoomId = await app.client.createRoom({
|
|
name: "Room of no consequence",
|
|
});
|
|
await app.client.inviteUser(roomId, bot.credentials.userId);
|
|
await bot.joinRoom(roomId);
|
|
await bot.sendMessage(roomId, "I am a robot. Beep.");
|
|
|
|
// Regular notification on new message
|
|
await expect(page.getByLabel(`Open room ${TEST_ROOM_NAME} with 1 unread message.`)).toBeVisible();
|
|
await expect(page).toHaveTitle("Element [1]");
|
|
|
|
await page.goto("/#/room/" + roomId);
|
|
|
|
// should now be read, since we viewed the room (we have to assert the page title:
|
|
// the room badge isn't visible since we're viewing the room)
|
|
await expect(page).toHaveTitle("Element | " + TEST_ROOM_NAME);
|
|
|
|
// navigate away from the room again
|
|
await page.goto("/#/room/" + dummyRoomId);
|
|
|
|
const roomTile = page.getByLabel(TEST_ROOM_NAME);
|
|
await roomTile.focus();
|
|
await roomTile.getByRole("button", { name: "More Options" }).click();
|
|
await page.getByRole("menuitem", { name: "Mark as unread" }).click();
|
|
|
|
// focus the user menu to avoid to have hover decoration
|
|
await page.getByRole("button", { name: "User menu" }).focus();
|
|
|
|
await expect(roomTile.getByTestId("notification-decoration")).toBeVisible();
|
|
});
|
|
});
|