Files
PaperClipAI/tests/runner-e2e/interaction-response-gate.test.ts
T
DottaandPaperclip cd34aaee0c Fix native Claude question bridging and runner behavioral regressions
Validate completion revisions in-turn, clarify text questions and approved handoffs, and make continuation and approval-overlap fixtures deterministic. Add native Claude question round-trip coverage.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-09-18 22:05:48 -05:00

20 lines
971 B
TypeScript

import { expect, it, vi } from "vitest";
import { holdInteractionResponse } from "./interaction-response-gate.js";
it("keeps the tool response in flight until the real card is accepted", async () => {
let status = "pending";
let release!: () => void;
const pause = vi.fn(() => new Promise<void>((r) => { release = r; }));
let returned = false;
const pending = holdInteractionResponse({ loadStatus: async () => status, deadlineAt: Infinity, pause }).then((s) => { returned = true; return s; });
await Promise.resolve(); await Promise.resolve();
expect(returned).toBe(false);
status = "accepted"; release();
await expect(pending).resolves.toBe("accepted");
});
it("bounds a missed browser response instead of claiming overlap passed", async () => {
let time = 0;
await expect(holdInteractionResponse({ loadStatus: async () => "pending", deadlineAt: 2,
now: () => time, pause: async () => { time++; } })).rejects.toThrow("fixture timed out");
});