2023-11-29 17:39:27 +01:00
|
|
|
/*
|
2024-09-09 15:57:16 +02:00
|
|
|
Copyright 2024 New Vector Ltd.
|
2023-11-29 17:39:27 +01:00
|
|
|
Copyright 2022 The Matrix.org Foundation C.I.C.
|
|
|
|
|
2024-09-09 15:57:16 +02:00
|
|
|
SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only
|
|
|
|
Please see LICENSE files in the repository root for full details.
|
2023-11-29 17:39:27 +01:00
|
|
|
*/
|
|
|
|
|
|
|
|
import { test, expect } from "../../element-web-test";
|
|
|
|
|
|
|
|
test.describe("UserView", () => {
|
|
|
|
test.use({
|
|
|
|
displayName: "Violet",
|
|
|
|
botCreateOpts: { displayName: "Usman" },
|
|
|
|
});
|
|
|
|
|
|
|
|
test("should render the user view as expected", async ({ page, homeserver, user, bot }) => {
|
|
|
|
await page.goto(`/#/user/${bot.credentials.userId}`);
|
|
|
|
|
2023-12-20 16:32:24 +01:00
|
|
|
const rightPanel = page.locator("#mx_RightPanel");
|
2023-11-29 17:39:27 +01:00
|
|
|
await expect(rightPanel.getByRole("heading", { name: bot.credentials.displayName, exact: true })).toBeVisible();
|
|
|
|
await expect(rightPanel.getByText("1 session")).toBeVisible();
|
2023-12-04 12:02:48 +01:00
|
|
|
await expect(rightPanel).toMatchScreenshot("user-info.png", {
|
|
|
|
mask: [page.locator(".mx_UserInfo_profile_mxid")],
|
2024-07-30 10:20:07 +02:00
|
|
|
css: `
|
|
|
|
/* Use monospace font for consistent mask width */
|
|
|
|
.mx_UserInfo_profile_mxid {
|
|
|
|
font-family: Inconsolata !important;
|
|
|
|
}
|
|
|
|
`,
|
2023-11-29 17:39:27 +01:00
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|