+
Something went wrong
+
{this.state.errorMessage ?? "Please try reloading the page."}
+
+
+ );
+ }
+
+ return this.props.children;
+ }
+}
diff --git a/frontend/src/components/__tests__/ErrorBoundary.test.tsx b/frontend/src/components/__tests__/ErrorBoundary.test.tsx
new file mode 100644
index 0000000..d90e4d3
--- /dev/null
+++ b/frontend/src/components/__tests__/ErrorBoundary.test.tsx
@@ -0,0 +1,33 @@
+import { describe, it, expect } from "vitest";
+import { render, screen } from "@testing-library/react";
+import { ErrorBoundary } from "../ErrorBoundary";
+
+function ExplodingChild(): React.ReactElement {
+ throw new Error("boom");
+}
+
+describe("ErrorBoundary", () => {
+ it("renders the fallback UI when a child throws", () => {
+ render(
+