Files
PaperClipAI/tests/runner-e2e/runtime-question-readiness.test.ts
T
DottaandPaperclip 8fb291310d Exercise installed legacy skills and grade real continuation outputs
Initialize the operational skill for legacy continuation fixtures, verify task attachment bytes, allow Claude’s optional custom-answer field, and distinguish unstarted dependency-blocked wakes from failed provider executions.

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

19 lines
1.2 KiB
TypeScript

import { expect, it } from "vitest";
import { answerableRuntimeRunIds } from "./runtime-question-readiness.js";
it("recognizes only a pending native question as an answerable active turn", () => {
const native = { kind: "ask_user_questions", status: "pending", sourceRunId: "live", payload: { runtimeRequestId: "request" } };
expect([...answerableRuntimeRunIds([native])]).toEqual(["live"]);
expect([...answerableRuntimeRunIds([{ ...native, status: "answered" }, { ...native, payload: {} }])]).toEqual([]);
});
import { isSingleClaudeQuestion } from "./runtime-question-readiness.js";
it("allows Claude's optional Other companion but rejects another substantive question", () => {
const choice = { id: "choice", answerMode: "single_select" };
const other = { id: "field-2-question_0_custom-hash", answerMode: "text", required: false, header: "Other" };
expect(isSingleClaudeQuestion([choice])).toBe(true);
expect(isSingleClaudeQuestion([choice, other])).toBe(true);
expect(isSingleClaudeQuestion([choice, { ...other, required: true }])).toBe(false);
expect(isSingleClaudeQuestion([choice, { ...other, id: "organization", header: "Organization" }])).toBe(false);
expect(isSingleClaudeQuestion([choice, other, other])).toBe(false);
});