|
| 1 | +/* |
| 2 | + * Copyright 2025 New Vector Ltd. |
| 3 | + * |
| 4 | + * SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Commercial |
| 5 | + * Please see LICENSE files in the repository root for full details. |
| 6 | + */ |
| 7 | + |
| 8 | +import { type Page } from "@playwright/test"; |
| 9 | + |
| 10 | +import { test, expect } from "../../../element-web-test"; |
| 11 | + |
| 12 | +test.describe("Room list", () => { |
| 13 | + test.use({ |
| 14 | + // labsFlags: ["feature_new_room_list"], |
| 15 | + }); |
| 16 | + |
| 17 | + /** |
| 18 | + * Get the room list |
| 19 | + * @param page |
| 20 | + */ |
| 21 | + function getRoomList(page: Page) { |
| 22 | + return page.getByTestId("room-list"); |
| 23 | + } |
| 24 | + |
| 25 | + test.beforeEach(async ({ page, app, user }) => { |
| 26 | + // The notification toast is displayed above the search section |
| 27 | + await app.closeNotificationToast(); |
| 28 | + for (let i = 0; i < 30; i++) { |
| 29 | + await app.client.createRoom({ name: `room${i}` }); |
| 30 | + } |
| 31 | + }); |
| 32 | + |
| 33 | + test("should render the legacy room list", { tag: "@screenshot" }, async ({ page, app, user }) => { |
| 34 | + const roomListView = page.locator(".mx_LeftPanel_roomListWrapper"); |
| 35 | + await expect(roomListView).toMatchScreenshot("room-list-legacy.png"); |
| 36 | + }); |
| 37 | + |
| 38 | + test.describe("Room list search", () => { |
| 39 | + test.use({ labsFlags: ["feature_new_room_list"] }); |
| 40 | + |
| 41 | + test("should render the room list", { tag: "@screenshot" }, async ({ page, app, user }) => { |
| 42 | + const roomListView = getRoomList(page); |
| 43 | + await expect(roomListView).toMatchScreenshot("room-list.png"); |
| 44 | + }); |
| 45 | + }); |
| 46 | +}); |
0 commit comments