fix(renderer): simplify sidebar and reset page errors
This commit is contained in:
1 parent
eabd304a45
commit
6ce7e63c71
6 files changed
+79
-50
No files matched your search
@@ -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",
|
||||
});
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user