mirror of
https://github.com/windmill-labs/windmill.git
synced 2026-08-20 00:02:19 +00:00
b39671d933
* 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>
41 lines
1.2 KiB
TypeScript
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);
|
|
});
|
|
});
|