Files
windmill/ai_evals/modes/flowFixtures.test.ts
centdix b39671d933 feat: add compact json patch tool to flow chat (#8840)
* fix: use compact json for flow patches

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* test: improve flow eval harness

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* test: record flow benchmark history

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* fix: preserve schema in set flow json

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* style: clean set flow json schema guard

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* fix: clean flow patch review followups

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-04-16 14:31:05 +00:00

41 lines
1.2 KiB
TypeScript

import { describe, expect, it } from "bun:test";
import { validateFlowState } from "../core/validators";
import { normalizeFlowInitialFixture } from "./flowFixtures";
describe("normalizeFlowInitialFixture", () => {
it("preserves initial flow metadata for validation", () => {
const initialFlow = {
summary: "existing summary",
value: {
modules: [
{
id: "a",
value: {
type: "rawscript",
language: "bun",
content: "export async function main() { return 1; }",
input_transforms: {},
},
},
],
},
schema: {
$schema: "https://json-schema.org/draft/2020-12/schema",
properties: {},
required: [],
type: "object",
},
};
const initial = normalizeFlowInitialFixture(initialFlow);
const checks = validateFlowState({
actual: structuredClone(initialFlow),
initial: initial.flowState,
});
const differsFromInitial = checks.find((check) => check.name === "flow differs from initial");
expect(initial.flowState?.summary).toBe("existing summary");
expect(differsFromInitial?.passed).toBe(false);
});
});