mirror of
https://github.com/snapotter-hq/SnapOtter.git
synced 2026-08-03 07:46:42 +02:00
feat(automate): make the pipeline builder fully multi-modal (#335)
* feat(shared): add outputModality to Tool metadata for crossing tools * feat(shared): add modalityForExtension, toolInputModality, toolOutputModality * fix(pipeline): route finalize and parent jobs to the pipeline's modality pool * feat(automate): add ConvertAudioControls pipeline step (exemplar) * feat(automate): add video tool settings controls to pipelines * feat(automate): add audio tool settings controls to pipelines * feat(automate): add document tool settings controls to pipelines * feat(automate): add chart-maker settings control to pipelines * feat(automate): warn on modality-incompatible pipeline steps * feat(automate): add single-file download button for pipeline results * refactor(automate): modality-aware icons, nav handler rename, mobile size bar * test(pipeline): cover audio, document, file, and cross-modality chains * i18n(automate): translate the modality-warning tooltip * test(pipeline): gate media-pool routing assertion on ffmpeg availability
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
import { describe, expect, it } from "vitest";
|
||||
import { computeStepWarnings } from "@/lib/pipeline-compat";
|
||||
|
||||
describe("computeStepWarnings", () => {
|
||||
it("flags an image->video step mismatch", () => {
|
||||
const w = computeStepWarnings(["resize", "trim-video"], "image");
|
||||
expect(w[0]).toBeNull();
|
||||
expect(w[1]).toEqual({ expects: "video", receives: "image" });
|
||||
});
|
||||
it("does not flag a valid cross-modality chain", () => {
|
||||
const w = computeStepWarnings(["extract-audio", "volume-adjust"], "video");
|
||||
expect(w[0]).toBeNull();
|
||||
expect(w[1]).toBeNull();
|
||||
});
|
||||
it("flags the first step against the uploaded file modality", () => {
|
||||
const w = computeStepWarnings(["resize"], "video");
|
||||
expect(w[0]).toEqual({ expects: "image", receives: "video" });
|
||||
});
|
||||
it("does not flag the first step when no file is uploaded yet", () => {
|
||||
expect(computeStepWarnings(["resize"], null)[0]).toBeNull();
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user