1
0
mirror of https://github.com/element-hq/element-web.git synced 2025-08-09 14:42:51 +03:00

Fix invite flake (#29812)

This commit is contained in:
Will Hunt
2025-04-25 14:09:53 +01:00
committed by GitHub
parent 6329f69557
commit adc110a8d9
3 changed files with 19 additions and 2 deletions

View File

@@ -15,6 +15,9 @@ const MEDIA_FILE = fs.readFileSync("playwright/sample-files/riot.png");
test.describe("Media preview settings", () => { test.describe("Media preview settings", () => {
test.use({ test.use({
displayName: "Alan", displayName: "Alan",
botCreateOpts: {
displayName: "Bob",
},
room: async ({ app, page, homeserver, bot, user }, use) => { room: async ({ app, page, homeserver, bot, user }, use) => {
const mxc = (await bot.uploadContent(MEDIA_FILE, { name: "image.png", type: "image/png" })).content_uri; const mxc = (await bot.uploadContent(MEDIA_FILE, { name: "image.png", type: "image/png" })).content_uri;
const roomId = await bot.createRoom({ const roomId = await bot.createRoom({
@@ -39,7 +42,14 @@ test.describe("Media preview settings", () => {
await app.viewRoomById(room.roomId); await app.viewRoomById(room.roomId);
await expect( await expect(
page.getByRole("complementary").filter({ hasText: "Do you want to join Test room" }), page.getByRole("complementary").filter({ hasText: "Do you want to join Test room" }),
).toMatchScreenshot("invite-no-avatar.png"); ).toMatchScreenshot("invite-no-avatar.png", {
// Hide the mxid, which is not stable.
css: `
.mx_RoomPreviewBar_inviter_mxid {
display: none !important;
}
`,
});
await expect( await expect(
page.getByRole("tree", { name: "Rooms" }).getByRole("treeitem", { name: "Test room" }), page.getByRole("tree", { name: "Rooms" }).getByRole("treeitem", { name: "Test room" }),
).toMatchScreenshot("invite-room-tree-no-avatar.png"); ).toMatchScreenshot("invite-room-tree-no-avatar.png");
@@ -52,7 +62,14 @@ test.describe("Media preview settings", () => {
await app.viewRoomById(room.roomId); await app.viewRoomById(room.roomId);
await expect( await expect(
page.getByRole("complementary").filter({ hasText: "Do you want to join Test room" }), page.getByRole("complementary").filter({ hasText: "Do you want to join Test room" }),
).toMatchScreenshot("invite-with-avatar.png"); ).toMatchScreenshot("invite-with-avatar.png", {
// Hide the mxid, which is not stable.
css: `
.mx_RoomPreviewBar_inviter_mxid {
display: none !important;
}
`,
});
await expect( await expect(
page.getByRole("tree", { name: "Rooms" }).getByRole("treeitem", { name: "Test room" }), page.getByRole("tree", { name: "Rooms" }).getByRole("treeitem", { name: "Test room" }),
).toMatchScreenshot("invite-room-tree-with-avatar.png"); ).toMatchScreenshot("invite-room-tree-with-avatar.png");

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

After

Width:  |  Height:  |  Size: 14 KiB