import { describe, expect, it } from "bun:test"; import { inlineFlowSchema } from "./inline-flow"; describe("inline flow schema", () => { it.each([ {}, { theme: {} }, { theme: { css: ":root {}" } }, { theme: { themeRuntimeArtifactId: "artifact_123" } }, { theme: { themeVersionId: "theme_123" } }, ] as const)("accepts optional theme fields", (themeInput) => { const flow = { definition: { blocks: [] }, ...themeInput }; expect(inlineFlowSchema.parse(flow)).toEqual(flow); }); it("rejects unknown theme fields", () => { expect( inlineFlowSchema.safeParse({ definition: { blocks: [] }, theme: { unknown: true }, }).success, ).toBe(false); }); });