test(FN-4493): refine Step 4 parser interop coverage

Fusion-Task-Id: FN-4493
Fusion-Task-Lineage: 966c7c55-fd51-4263-9d4e-87e9d06bfb6f
This commit is contained in:
Fusion
2026-05-14 12:07:13 -07:00
committed by gsxdsm
parent bacef5be81
commit a877425cf3

View File

@@ -17,10 +17,20 @@ describe("workflow step template verdict interoperability", () => {
const template = WORKFLOW_STEP_TEMPLATES.find((entry) => entry.id === id);
expect(template).toBeTruthy();
expect(parseWorkflowStepVerdict('{"verdict":"APPROVE","notes":""}')).toEqual({ verdict: "APPROVE", notes: "" });
expect(parseWorkflowStepVerdict('{"verdict":"APPROVE","notes":"out of scope: no UI files changed"}')).toEqual({
const promptBody = template!.prompt;
expect(promptBody).toContain('"verdict":"APPROVE|APPROVE_WITH_NOTES|REVISE"');
expect(parseWorkflowStepVerdict('{"verdict":"APPROVE","notes":""}')).toEqual({
verdict: "APPROVE",
notes: "out of scope: no UI files changed",
notes: "",
});
expect(parseWorkflowStepVerdict(`{"verdict":"APPROVE","notes":"out of scope: ${id}"}`)).toEqual({
verdict: "APPROVE",
notes: `out of scope: ${id}`,
});
expect(parseWorkflowStepVerdict(`{"verdict":"APPROVE_WITH_NOTES","notes":"advisory only: ${id}"}`)).toEqual({
verdict: "APPROVE_WITH_NOTES",
notes: `advisory only: ${id}`,
});
expect(inferWorkflowStepVerdictFromProse("REQUEST REVISION\nfix packages/foo.ts")).toEqual({
verdict: "REVISE",