|
| 1 | +/* |
| 2 | +Copyright 2022-2023 The Matrix.org Foundation C.I.C. |
| 3 | +
|
| 4 | +Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | +you may not use this file except in compliance with the License. |
| 6 | +You may obtain a copy of the License at |
| 7 | +
|
| 8 | + http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | +
|
| 10 | +Unless required by applicable law or agreed to in writing, software |
| 11 | +distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | +See the License for the specific language governing permissions and |
| 14 | +limitations under the License. |
| 15 | +*/ |
| 16 | + |
| 17 | +import { test, expect } from "../../element-web-test"; |
| 18 | + |
| 19 | +test.describe("Create Room", () => { |
| 20 | + test.use({ displayName: "Jim" }); |
| 21 | + |
| 22 | + test("should allow us to create a public room with name, topic & address set", async ({ page, user, app }) => { |
| 23 | + const name = "Test room 1"; |
| 24 | + const topic = "This room is dedicated to this test and this test only!"; |
| 25 | + |
| 26 | + const dialog = await app.openCreateRoomDialog(); |
| 27 | + // Fill name & topic |
| 28 | + await dialog.getByRole("textbox", { name: "Name" }).fill(name); |
| 29 | + await dialog.getByRole("textbox", { name: "Topic" }).fill(topic); |
| 30 | + // Change room to public |
| 31 | + await dialog.getByRole("button", { name: "Room visibility" }).click(); |
| 32 | + await dialog.getByRole("option", { name: "Public room" }).click(); |
| 33 | + // Fill room address |
| 34 | + await dialog.getByRole("textbox", { name: "Room address" }).fill("test-room-1"); |
| 35 | + // Submit |
| 36 | + await dialog.getByRole("button", { name: "Create room" }).click(); |
| 37 | + |
| 38 | + await expect(page).toHaveURL(/\/#\/room\/#test-room-1:localhost/); |
| 39 | + const header = page.locator(".mx_LegacyRoomHeader"); |
| 40 | + await expect(header).toContainText(name); |
| 41 | + await expect(header).toContainText(topic); |
| 42 | + }); |
| 43 | +}); |
0 commit comments