mirror of
https://github.com/vector-im/element-web.git
synced 2026-05-05 20:26:19 +02:00
Create new snapshot tests
This commit is contained in:
parent
782921f5ac
commit
2c416f7e7b
@ -11,7 +11,7 @@ import { test, expect } from "../../element-web-test";
|
||||
test.describe("Create Room", () => {
|
||||
test.use({ displayName: "Jim" });
|
||||
|
||||
test("should allow us to create a public room with name, topic & address set", async ({ page, user, app }) => {
|
||||
test("should allow us to create a public room with name, topic & address set", { tag: "@screenshot" }, async ({ page, user, app }) => {
|
||||
const name = "Test room 1";
|
||||
const topic = "This room is dedicated to this test and this test only!";
|
||||
|
||||
@ -26,6 +26,8 @@ test.describe("Create Room", () => {
|
||||
await dialog.getByRole("textbox", { name: "Room address" }).fill("test-room-1");
|
||||
// Submit
|
||||
await dialog.getByRole("button", { name: "Create room" }).click();
|
||||
|
||||
await expect(dialog).toMatchScreenshot("create-room.png");
|
||||
|
||||
await expect(page).toHaveURL(new RegExp(`/#/room/#test-room-1:${user.homeServer}`));
|
||||
const header = page.locator(".mx_RoomHeader");
|
||||
|
||||
@ -0,0 +1,31 @@
|
||||
/*
|
||||
Copyright 2024 New Vector Ltd.
|
||||
Copyright 2023 Suguru Hirahara
|
||||
Copyright 2023 The Matrix.org Foundation C.I.C.
|
||||
|
||||
SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Commercial
|
||||
Please see LICENSE files in the repository root for full details.
|
||||
*/
|
||||
|
||||
import { test, expect } from "../../element-web-test";
|
||||
|
||||
test.describe("Decline and block invite dialog", function () {
|
||||
test.use({
|
||||
displayName: "Hanako",
|
||||
botCreateOpts: {
|
||||
displayName: "BotAlice",
|
||||
},
|
||||
});
|
||||
|
||||
const botName = "BotAlice";
|
||||
|
||||
test("should support rejecting a user invite", { tag: "@screenshot" }, async ({ page, app, user, bot }) => {
|
||||
// Create and view a room
|
||||
await bot.createRoom({ name: "Test Room", invite: [user.userId] });
|
||||
await app.viewRoomByName("Test Room");
|
||||
await page.getByRole("button", { name: "Decline and block" }).click();
|
||||
|
||||
// Take a snapshot of the invite dialog with a user pill
|
||||
await expect(page.locator(".mx_Dialog")).toMatchScreenshot("decline-and-block-invite-empty.png");
|
||||
});
|
||||
});
|
||||
Loading…
x
Reference in New Issue
Block a user