mirror of
https://github.com/vector-im/element-call.git
synced 2026-12-04 10:21:10 +08:00
Compare commits
10
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
dfc3711811 | ||
|
|
e5e61a0769 | ||
|
|
c128c298b3 | ||
|
|
0041a04138 | ||
|
|
1612771502 | ||
|
|
c3ba3d8e16 | ||
|
|
975eae92b4 | ||
|
|
a0e9dec1e5 | ||
|
|
5597ef2249 | ||
|
|
f60a63e20c |
@@ -19,10 +19,10 @@ services:
|
||||
- ./backend/playwright_homeserver-othersite.yaml:/data/cfg/homeserver.yaml:Z
|
||||
element-web:
|
||||
# Pin to a SHA so that upstream cannot break our tests. Renovate handles regular updates.
|
||||
image: ghcr.io/element-hq/element-web:develop@sha256:a9fba6e7ea9a32f62bc1459fcdad790662476ff1b2bcebc62fe47e5cf51e3932
|
||||
image: ghcr.io/element-hq/element-web:develop@sha256:5c9a8288deccb648e0d590776dff747ba674fe45c32cada6f804776800a38d2c
|
||||
element-web-1:
|
||||
# Pin to a SHA so that upstream cannot break our tests. Renovate handles regular updates.
|
||||
image: ghcr.io/element-hq/element-web:develop@sha256:a9fba6e7ea9a32f62bc1459fcdad790662476ff1b2bcebc62fe47e5cf51e3932
|
||||
image: ghcr.io/element-hq/element-web:develop@sha256:5c9a8288deccb648e0d590776dff747ba674fe45c32cada6f804776800a38d2c
|
||||
volumes:
|
||||
# The other site opens the embedded package under test in place of the
|
||||
# copy its image bundles (the first site opens the dev server's app.
|
||||
|
||||
+1
-1
@@ -96,6 +96,7 @@
|
||||
},
|
||||
"mute_all_audio": "Mute all audio (participants, reactions, join sounds)",
|
||||
"show_connection_stats": "Show connection statistics",
|
||||
"throw_error_button": "Throw test error",
|
||||
"url_params": "URL parameters"
|
||||
},
|
||||
"disconnected_banner": "Connectivity to the server has been lost.",
|
||||
@@ -142,7 +143,6 @@
|
||||
},
|
||||
"handset": {
|
||||
"overlay_back_button": "Back to Speaker Mode",
|
||||
"overlay_description": "Only works while using app",
|
||||
"overlay_title": "Handset Mode"
|
||||
},
|
||||
"hangup_button_label": "End call",
|
||||
|
||||
@@ -422,6 +422,9 @@ test.describe("a background of one's own", () => {
|
||||
).toBeVisible();
|
||||
await expect(mine).toHaveCount(0);
|
||||
await page.keyboard.press("Escape");
|
||||
// While it animates out the menu still counts as visible: addImage would
|
||||
// then leave it closed instead of opening it again
|
||||
await expect(page.getByRole("menu")).toBeHidden();
|
||||
|
||||
await addImage(page, red);
|
||||
await expect(mine).toBeVisible();
|
||||
|
||||
@@ -0,0 +1,64 @@
|
||||
/*
|
||||
Copyright 2026 Element Creations Ltd.
|
||||
|
||||
SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial
|
||||
Please see LICENSE in the repository root for full details.
|
||||
*/
|
||||
|
||||
import { expect, test } from "@playwright/test";
|
||||
|
||||
import { widgetTest } from "../fixtures/widget-user.ts";
|
||||
import { TestHelpers } from "./test-helpers.ts";
|
||||
|
||||
widgetTest.skip(
|
||||
({ browserName }) => browserName === "firefox",
|
||||
"Widget specs only run on Chromium, see simple-create.spec.ts",
|
||||
);
|
||||
|
||||
widgetTest(
|
||||
"Switching rooms away from a crashed call dismisses it for good",
|
||||
async ({ asWidget }) => {
|
||||
test.slow();
|
||||
const { brooks } = asWidget;
|
||||
const page = brooks.page;
|
||||
const call = page.locator('iframe[title="Element Call"]');
|
||||
const callFrame = call.contentFrame();
|
||||
|
||||
// Somewhere to switch to once the call has crashed
|
||||
await TestHelpers.createRoom("Other Room", page);
|
||||
await TestHelpers.switchToRoomNamed(page, "Welcome Room");
|
||||
|
||||
await TestHelpers.startCallInCurrentRoom(page);
|
||||
// A dev server compiles the widget on first load
|
||||
await expect(callFrame.getByTestId("lobby_joinCall")).toBeVisible({
|
||||
timeout: 30000,
|
||||
});
|
||||
await TestHelpers.joinCallFromLobby(page);
|
||||
await expect(
|
||||
callFrame.getByRole("button", { name: "End call" }),
|
||||
).toBeVisible();
|
||||
|
||||
// Crash the call from its developer settings
|
||||
await callFrame.getByRole("button", { name: "Settings" }).click();
|
||||
await callFrame.getByRole("tab", { name: "Preferences" }).click();
|
||||
await callFrame.getByText("Developer mode", { exact: true }).check();
|
||||
await callFrame.getByRole("tab", { name: "Developer" }).click();
|
||||
await callFrame.getByRole("button", { name: "Throw test error" }).click();
|
||||
await expect(callFrame.getByText("Something went wrong")).toBeVisible();
|
||||
|
||||
// Showing the call collapses the room list
|
||||
await TestHelpers.expandRoomList(page);
|
||||
await TestHelpers.switchToRoomNamed(page, "Other Room");
|
||||
await expect(
|
||||
page.getByRole("main").getByRole("heading", { name: "Other Room" }),
|
||||
).toBeVisible();
|
||||
|
||||
// The crashed call is gone and stays gone: no restart, no reconnect
|
||||
await expect(call).toHaveCount(0);
|
||||
await page.waitForTimeout(5000);
|
||||
await expect(call).toHaveCount(0);
|
||||
await expect(
|
||||
page.getByRole("main").getByRole("heading", { name: "Other Room" }),
|
||||
).toBeVisible();
|
||||
},
|
||||
);
|
||||
@@ -6,7 +6,7 @@ Please see LICENSE in the repository root for full details.
|
||||
*/
|
||||
|
||||
import { type FC } from "react";
|
||||
import { BigIcon, Button, Heading, Text } from "@vector-im/compound-web";
|
||||
import { BigIcon, Button, Heading } from "@vector-im/compound-web";
|
||||
import { VoiceCallIcon } from "@vector-im/compound-design-tokens/assets/web/icons";
|
||||
import { useTranslation } from "react-i18next";
|
||||
|
||||
@@ -27,7 +27,6 @@ export const EarpieceOverlay: FC<Props> = ({ show, onBackToVideoPressed }) => {
|
||||
<Heading as="h2" weight="semibold" size="md">
|
||||
{t("handset.overlay_title")}
|
||||
</Heading>
|
||||
<Text>{t("handset.overlay_description")}</Text>
|
||||
<Button
|
||||
kind="primary"
|
||||
size="md"
|
||||
|
||||
@@ -145,11 +145,6 @@ exports[`InCallView > rendering > renders 1`] = `
|
||||
>
|
||||
Handset Mode
|
||||
</h2>
|
||||
<p
|
||||
class="_typography_6v6n8_153 _font-body-md-regular_6v6n8_50"
|
||||
>
|
||||
Only works while using app
|
||||
</p>
|
||||
<button
|
||||
class="_button_1nw83_8"
|
||||
data-kind="primary"
|
||||
|
||||
@@ -30,6 +30,9 @@ import {
|
||||
} from "@element-hq/matrixrtc-sdk";
|
||||
import type * as MatrixRTCSdk from "@element-hq/matrixrtc-sdk";
|
||||
import { exampleTransport, mockConfig } from "../utils/test";
|
||||
import { GroupCallErrorBoundary } from "../room/GroupCallErrorBoundary";
|
||||
import { LeaveToHomeProvider } from "../LeaveToHomeContext";
|
||||
import { ElementCallError, ErrorCode } from "../utils/errors";
|
||||
|
||||
// Mock url params hook to avoid environment-dependent snapshot churn.
|
||||
vi.mock("../UrlParams", () => ({
|
||||
@@ -541,4 +544,38 @@ describe("DeveloperSettingsTab", () => {
|
||||
);
|
||||
});
|
||||
});
|
||||
describe("throw test error", () => {
|
||||
it("throws an ElementCallError that the error boundary shows", async () => {
|
||||
const user = userEvent.setup();
|
||||
const client = createMockMatrixClient();
|
||||
const onError = vi.fn();
|
||||
|
||||
render(
|
||||
<LeaveToHomeProvider value={vi.fn()}>
|
||||
<GroupCallErrorBoundary
|
||||
onError={onError}
|
||||
recoveryActionHandler={vi.fn()}
|
||||
>
|
||||
<TooltipProvider>
|
||||
<DeveloperSettingsTab
|
||||
client={client}
|
||||
env={{} as unknown as ImportMetaEnv}
|
||||
vm={outOfCallDeveloperSettingsTabViewModel}
|
||||
/>
|
||||
</TooltipProvider>
|
||||
</GroupCallErrorBoundary>
|
||||
</LeaveToHomeProvider>,
|
||||
);
|
||||
|
||||
await user.click(
|
||||
screen.getByRole("button", { name: "Throw test error" }),
|
||||
);
|
||||
|
||||
expect(await screen.findByText("Something went wrong")).toBeVisible();
|
||||
expect(onError).toHaveBeenCalledOnce();
|
||||
const error = onError.mock.calls[0][0] as unknown;
|
||||
expect(error).toBeInstanceOf(ElementCallError);
|
||||
expect((error as ElementCallError).code).toBe(ErrorCode.UNKNOWN_ERROR);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -22,6 +22,7 @@ import {
|
||||
import { logger } from "matrix-js-sdk/lib/logger";
|
||||
import { type UnstableLivekitTransport } from "matrix-js-sdk/lib/matrixrtc";
|
||||
import {
|
||||
Button,
|
||||
EditInPlace,
|
||||
ErrorMessage,
|
||||
Root as Form,
|
||||
@@ -72,6 +73,7 @@ import {
|
||||
} from "@element-hq/matrixrtc-sdk";
|
||||
import { useBehavior } from "../useBehavior";
|
||||
import { type ViewModel } from "../state/ViewModel.ts";
|
||||
import { type ElementCallError, UnknownCallError } from "../utils/errors.ts";
|
||||
|
||||
/**
|
||||
* The state of MatrixRTC's media key rotation.
|
||||
@@ -212,6 +214,22 @@ export const DeveloperSettingsTab: FC<Props> = ({
|
||||
|
||||
const urlParams = useUrlParams();
|
||||
|
||||
// An error thrown from a click handler never reaches an error boundary, so
|
||||
// the button only records it and the next render throws it instead.
|
||||
const [errorToThrow, setErrorToThrow] = useState<ElementCallError | null>(
|
||||
null,
|
||||
);
|
||||
const throwTestError = useCallback(
|
||||
() =>
|
||||
setErrorToThrow(
|
||||
new UnknownCallError(
|
||||
new Error("Test error thrown from the developer settings"),
|
||||
),
|
||||
),
|
||||
[],
|
||||
);
|
||||
if (errorToThrow !== null) throw errorToThrow;
|
||||
|
||||
const MediaQualitySettings: React.FC<{
|
||||
id: string;
|
||||
header: string;
|
||||
@@ -678,6 +696,10 @@ export const DeveloperSettingsTab: FC<Props> = ({
|
||||
<Separator />
|
||||
<AudioProcessingSettings />
|
||||
<Separator />
|
||||
<Button kind="secondary" destructive onClick={throwTestError}>
|
||||
{t("developer_mode.throw_error_button")}
|
||||
</Button>
|
||||
<Separator />
|
||||
<p>{t("developer_mode.environment_variables")}</p>
|
||||
<pre className={styles.pre}>{JSON.stringify(env, null, 2)}</pre>
|
||||
<p>{t("developer_mode.url_params")}</p>
|
||||
|
||||
@@ -635,6 +635,21 @@ exports[`DeveloperSettingsTab > renders and matches snapshot 1`] = `
|
||||
data-orientation="horizontal"
|
||||
role="separator"
|
||||
/>
|
||||
<button
|
||||
class="_button_1nw83_8 _destructive_1nw83_110"
|
||||
data-kind="secondary"
|
||||
data-size="lg"
|
||||
role="button"
|
||||
tabindex="0"
|
||||
>
|
||||
Throw test error
|
||||
</button>
|
||||
<div
|
||||
class="_separator_13qwf_8"
|
||||
data-kind="primary"
|
||||
data-orientation="horizontal"
|
||||
role="separator"
|
||||
/>
|
||||
<p>
|
||||
Environment variables
|
||||
</p>
|
||||
|
||||
Reference in New Issue
Block a user