2023-11-30 00:39:27 +08:00
|
|
|
/*
|
2024-09-09 21:57:16 +08:00
|
|
|
Copyright 2024 New Vector Ltd.
|
2023-11-30 00:39:27 +08:00
|
|
|
Copyright 2022 The Matrix.org Foundation C.I.C.
|
|
|
|
|
2024-09-09 21:57:16 +08: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-30 00:39:27 +08: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 23:32:24 +08:00
|
|
|
const rightPanel = page.locator("#mx_RightPanel");
|
2023-11-30 00:39:27 +08:00
|
|
|
await expect(rightPanel.getByRole("heading", { name: bot.credentials.displayName, exact: true })).toBeVisible();
|
|
|
|
await expect(rightPanel.getByText("1 session")).toBeVisible();
|
2023-12-04 19:02:48 +08:00
|
|
|
await expect(rightPanel).toMatchScreenshot("user-info.png", {
|
|
|
|
mask: [page.locator(".mx_UserInfo_profile_mxid")],
|
2024-07-30 16:20:07 +08:00
|
|
|
css: `
|
|
|
|
/* Use monospace font for consistent mask width */
|
|
|
|
.mx_UserInfo_profile_mxid {
|
|
|
|
font-family: Inconsolata !important;
|
|
|
|
}
|
|
|
|
`,
|
2023-11-30 00:39:27 +08:00
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|