diff --git a/src/room/GroupCallErrorBoundary.test.tsx b/src/room/GroupCallErrorBoundary.test.tsx index 94c96794..893389a7 100644 --- a/src/room/GroupCallErrorBoundary.test.tsx +++ b/src/room/GroupCallErrorBoundary.test.tsx @@ -7,7 +7,13 @@ Please see LICENSE in the repository root for full details. import { describe, expect, test, vi } from "vitest"; import { render, screen } from "@testing-library/react"; -import { type ReactElement, type ReactNode } from "react"; +import { + type FC, + type ReactElement, + type ReactNode, + useCallback, + useState, +} from "react"; import { BrowserRouter } from "react-router-dom"; import userEvent from "@testing-library/user-event"; @@ -131,6 +137,42 @@ test("should have a reconnect button for ConnectionLostError", async () => { expect(reconnectCallback).toHaveBeenCalledWith("reconnect"); }); +test("Action handling should reset error state", async () => { + const user = userEvent.setup(); + + const TestComponent: FC<{ fail: boolean }> = ({ fail }): ReactNode => { + if (fail) { + throw new ConnectionLostError(); + } + return