Start voice call in PiP (not in fullscreen) (#34055)

* start voice call in pip

* Update jest.config.ts

* fix "join" button to use correct intent

* Add regression test for join button

* Update RoomHeader-test.tsx

* fmt

* Add playwright test

* Fix expected intent on "join" button press

* Add additional pip check to exising:
`should be able to join a ${callType} call in progress` test

* Update RoomHeader-test.tsx
This commit is contained in:
Timo
2026-07-06 15:57:26 +00:00
committed by GitHub
parent 3153912cc1
commit 20587b3495
5 changed files with 123 additions and 5 deletions
@@ -217,8 +217,23 @@ test.describe("Element Call", () => {
const hash = new URLSearchParams(url.hash.slice(1));
assertCommonCallParameters(url.searchParams, hash, user, room);
expect(hash.get("intent")).toEqual("join_existing");
const expectedIntent = callType === "voice" ? "join_existing_voice" : "join_existing";
expect(hash.get("intent")).toEqual(expectedIntent);
expect(hash.get("skipLobby")).toEqual(null);
// pip layout check
switch (callType) {
case "voice": {
const pipContainer = page.getByTestId("widget-pip-container");
await expect(pipContainer).toBeVisible();
break;
}
case "video": {
const pipContainer = page.getByTestId("widget-pip-container");
await expect(pipContainer).not.toBeVisible();
break;
}
}
});
});
@@ -336,6 +351,22 @@ test.describe("Element Call", () => {
expect(hash.get("skipLobby")).toEqual("true");
});
test("should start a voice call in PiP", async ({ page, user, room, app }) => {
await app.viewRoomById(room.roomId);
await expect(page.getByText("Bob joined the room")).toBeVisible();
await page.getByRole("button", { name: "Voice call" }).click();
await page.getByRole("menuitem", { name: "Element Call" }).click();
const frameUrlStr = await page.locator("iframe").getAttribute("src");
await expect(frameUrlStr).toBeDefined();
// The call should be presented in the picture-in-picture container, right in the room we started it
// from, rather than taking over the room view.
const pipContainer = page.getByTestId("widget-pip-container");
await expect(pipContainer).toBeVisible();
});
test("should be able to join a call in progress", async ({ page, user, bot, room, app }) => {
await app.viewRoomById(room.roomId);
await expect(page.getByText("Bob joined the room")).toBeVisible();