Fixed how payload-as-prompt is handled and progress comment updates (#212)

This commit is contained in:
Mateusz Burzyński
2026-02-01 22:13:39 +00:00
committed by pullfrog[bot]
parent 18ba8e5fd0
commit bfe72ac2cf
8 changed files with 126 additions and 166 deletions
+14 -6
View File
@@ -49,16 +49,19 @@ describe("Inputs schema", () => {
});
describe("JsonPayload schema", () => {
it("requires ~pullfrog and version", () => {
const result = JsonPayload.assert({ "~pullfrog": true, version: "1.2.3" });
expect(result).toMatchObject({ "~pullfrog": true, version: "1.2.3" });
it("requires ~pullfrog and version and prompt", () => {
const result = JsonPayload.assert({
"~pullfrog": true,
version: "1.2.3",
prompt: "test prompt",
});
expect(result).toMatchObject({ "~pullfrog": true, version: "1.2.3", prompt: "test prompt" });
expect(() => JsonPayload.assert({})).toThrow();
expect(() => JsonPayload.assert({ "~pullfrog": true })).toThrow();
expect(() => JsonPayload.assert({ version: "1.2.3" })).toThrow();
});
it.each([
["prompt", "test prompt"],
["agent", "claude"],
["agent", "codex"],
["agent", "cursor"],
@@ -72,12 +75,17 @@ describe("JsonPayload schema", () => {
["timeout", "30s"],
["event", { trigger: "unknown" }],
] as const)("should accept optional %s with value %s", (prop, value) => {
const input = { "~pullfrog": true, version: "1.2.3", [prop]: value };
const input = { "~pullfrog": true, version: "1.2.3", prompt: "test prompt", [prop]: value };
expect(() => JsonPayload.assert(input)).not.toThrow();
});
it.each([["agent"], ["effort"]] as const)("should reject invalid %s values", (prop) => {
const input = { "~pullfrog": true, version: "1.2.3", [prop]: "invalid" as any };
const input = {
"~pullfrog": true,
version: "1.2.3",
prompt: "test prompt",
[prop]: "invalid" as any,
};
expect(() => JsonPayload.assert(input)).toThrow();
});
});