From b02ad8871e26953ae92f0b8fde4fc8c7e29a66f6 Mon Sep 17 00:00:00 2001 From: Valere Date: Wed, 12 Mar 2025 10:27:45 +0100 Subject: [PATCH] review: Make widget prop mandatory --- src/RichError.tsx | 3 ++- src/livekit/useECConnectionState.test.tsx | 2 +- src/room/GroupCallErrorBoundary.test.tsx | 14 ++++++++++++-- src/room/GroupCallErrorBoundary.tsx | 2 +- 4 files changed, 16 insertions(+), 5 deletions(-) diff --git a/src/RichError.tsx b/src/RichError.tsx index f206b192..699486e2 100644 --- a/src/RichError.tsx +++ b/src/RichError.tsx @@ -10,6 +10,7 @@ import { PopOutIcon } from "@vector-im/compound-design-tokens/assets/web/icons"; import type { FC, ReactNode } from "react"; import { ErrorView } from "./ErrorView"; +import { widget } from "./widget.ts"; /** * An error consisting of a terse message to be logged to the console and a @@ -32,7 +33,7 @@ const OpenElsewhere: FC = () => { return ( diff --git a/src/livekit/useECConnectionState.test.tsx b/src/livekit/useECConnectionState.test.tsx index 0b13e6ce..287ee4dc 100644 --- a/src/livekit/useECConnectionState.test.tsx +++ b/src/livekit/useECConnectionState.test.tsx @@ -60,7 +60,7 @@ test.each<[string, ConnectionError]>([ const user = userEvent.setup(); render( - + , diff --git a/src/room/GroupCallErrorBoundary.test.tsx b/src/room/GroupCallErrorBoundary.test.tsx index 5d171642..f2a10bc2 100644 --- a/src/room/GroupCallErrorBoundary.test.tsx +++ b/src/room/GroupCallErrorBoundary.test.tsx @@ -67,6 +67,7 @@ test.each([ @@ -95,6 +96,7 @@ test("should render the error page with link back to home", async () => { @@ -139,7 +141,10 @@ test("ConnectionLostError: Action handling should reset error state", async () = return ( - + @@ -181,6 +186,7 @@ describe("Rageshake button", () => { @@ -221,7 +227,11 @@ test("should have a close button in widget mode", async () => { const onErrorMock = vi.fn(); const { asFragment } = render( - + , diff --git a/src/room/GroupCallErrorBoundary.tsx b/src/room/GroupCallErrorBoundary.tsx index d84cb2a1..170718d6 100644 --- a/src/room/GroupCallErrorBoundary.tsx +++ b/src/room/GroupCallErrorBoundary.tsx @@ -106,7 +106,7 @@ interface BoundaryProps { children: ReactNode | (() => ReactNode); recoveryActionHandler: RecoveryActionHandler; onError?: (error: unknown) => void; - widget?: WidgetHelpers | null; + widget: WidgetHelpers | null; } export const GroupCallErrorBoundary = ({