mirror of
https://github.com/vector-im/element-web.git
synced 2025-08-10 00:07:05 +02:00
Fix invite flake (#29812)
This commit is contained in:
parent
6329f69557
commit
adc110a8d9
@ -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 |
Loading…
Reference in New Issue
Block a user