fix(renderer): simplify sidebar and reset page errors

This commit is contained in:
ZacharyZhang-NY committed 2026-04-24 10:08:07 -04:00
1 parent eabd304a45
commit 6ce7e63c71
6 files changed
+79 -50

No files matched your search

+19
View File
@@ -0,0 +1,19 @@
import { describe, expect, it } from "vitest";
import { ErrorBoundary } from "../../src/renderer/components/ui";
describe("ErrorBoundary", () => {
it("resets a captured page error when the section changes", () => {
const error = new Error("boom");
const failedState = {
hasError: true,
error,
resetKey: "runs",
};
expect(ErrorBoundary.getDerivedStateFromProps({ children: null, resetKey: "tasks" }, failedState)).toEqual({
hasError: false,
error: null,
resetKey: "tasks",
});
});
});