Move room name, avatar, and topic to IOpts. (#30981)

This commit is contained in:
Skye Elliot
2025-10-31 12:20:02 +00:00
committed by GitHub
parent a9bb046e52
commit 73fa27887d
7 changed files with 380 additions and 32 deletions
+11
View File
@@ -70,6 +70,17 @@ describe("createRoom", () => {
});
});
it("creates a public room with a topic", async () => {
await createRoom(client, { createOpts: { preset: Preset.PublicChat }, topic: "My topic" });
expect(client.createRoom).toHaveBeenCalledWith({
preset: "public_chat",
visibility: "private",
topic: "My topic",
initial_state: [{ state_key: "", type: "m.room.guest_access", content: { guest_access: "can_join" } }],
});
});
it("creates a public room in a space", async () => {
const roomId = await createRoom(client, { roomType: RoomType.Space });
const parentSpace = client.getRoom(roomId!)!;