mirror of
https://github.com/paperclipai/paperclip.git
synced 2026-10-24 18:19:05 +02:00
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>
20 lines
971 B
TypeScript
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");
|
|
});
|