test: cover integrated worktree provenance state

Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
DottaandPaperclip committed 2026-08-25 19:31:23 +00:00
1 parent 26a70232d5
commit 8ff25515f8
3 files changed
+7 -4

No files matched your search

+4 -4
View File
@@ -1,7 +1,7 @@
// @vitest-environment jsdom
import { act } from "react";
import type { ComponentProps, ReactNode } from "react";
import { flushSync } from "react-dom";
import { createRoot, type Root } from "react-dom/client";
import type { ActivityEvent, Issue, RunLivenessState } from "@paperclipai/shared";
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
@@ -30,13 +30,13 @@ beforeEach(() => {
});
afterEach(() => {
act(() => root.unmount());
flushSync(() => root.unmount());
container.remove();
vi.useRealTimers();
});
function render(ui: ReactNode) {
act(() => {
flushSync(() => {
root.render(ui);
});
}
@@ -469,7 +469,7 @@ describe("IssueRunLedger", () => {
(button) => button.textContent?.includes("Continue monitoring"),
);
expect(continueButton).not.toBeUndefined();
act(() => {
flushSync(() => {
continueButton?.dispatchEvent(new MouseEvent("click", { bubbles: true }));
});
expect(onWatchdogDecision).toHaveBeenCalledWith({
@@ -29,6 +29,8 @@ function armed(overrides: Partial<WorktreeRunEngineStatus> = {}): WorktreeRunEng
armed: true,
cutoff: "2026-07-10T18:34:00.000Z",
activationInstanceId: "nonce-aaaaaaaa1111",
instanceNonce: "nonce-aaaaaaaa1111",
seedEpoch: "epoch-bbbbbbbb2222",
reason: null,
},
instanceNonce: "nonce-aaaaaaaa1111",
@@ -103,6 +103,7 @@ function defaultExperimentalSettings(): InstanceExperimentalSettingsPayload {
enableSandboxDuplexBridge: false,
enableWorktreeRunExecution: false,
worktreeRunExecutionInstanceNonce: null,
worktreeRunExecutionSeedEpoch: null,
worktreeRunExecutionActivatedAt: null,
worktreeRunExecutionActivationInstanceId: null,
};