feat(canvas): add video-prompt node and enhance video generation support
- Introduced a new node type "video-prompt" for AI video generation, including its integration into the canvas command palette and node template picker. - Updated connection validation to allow connections from text nodes to video-prompt and from video-prompt to ai-video nodes. - Enhanced error handling and messaging for video generation failures, including specific cases for provider issues. - Added tests to validate new video-prompt functionality and connection policies. - Updated localization files to include new labels and prompts for video-prompt and ai-video nodes.
This commit is contained in:
22
tests/lib/video-poll-logging.test.ts
Normal file
22
tests/lib/video-poll-logging.test.ts
Normal file
@@ -0,0 +1,22 @@
|
||||
import { describe, expect, it } from "vitest";
|
||||
|
||||
import {
|
||||
shouldLogVideoPollAttempt,
|
||||
shouldLogVideoPollResult,
|
||||
} from "@/lib/video-poll-logging";
|
||||
|
||||
describe("video poll logging", () => {
|
||||
it("logs only the first and every fifth in-progress attempt", () => {
|
||||
expect(shouldLogVideoPollAttempt(1)).toBe(true);
|
||||
expect(shouldLogVideoPollAttempt(2)).toBe(false);
|
||||
expect(shouldLogVideoPollAttempt(5)).toBe(true);
|
||||
expect(shouldLogVideoPollAttempt(6)).toBe(false);
|
||||
});
|
||||
|
||||
it("always logs terminal poll results", () => {
|
||||
expect(shouldLogVideoPollResult(2, "IN_PROGRESS")).toBe(false);
|
||||
expect(shouldLogVideoPollResult(5, "IN_PROGRESS")).toBe(true);
|
||||
expect(shouldLogVideoPollResult(17, "COMPLETED")).toBe(true);
|
||||
expect(shouldLogVideoPollResult(3, "FAILED")).toBe(true);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user