Skip to content

armgit / fuobe

Public Imported from GitHub
0

The open creative studio on ComfyUI: images, video, 3D and audio on open weights, on your own GPU or the cloud. Camera motions, effects, apps, Cinema, Layers, Image to 3D and an AI agent.

Faceless tests: stage two starts from the background sweep with nobody reading the episode

Claude04756d8cd53c
diff --git a/tests/faceless-api.test.ts b/tests/faceless-api.test.ts
index 4f924167..5a4cbe0f 100644
--- a/tests/faceless-api.test.ts
+++ b/tests/faceless-api.test.ts
@@ -372,6 +372,18 @@ describe("Episodes", () => {
expect(faceless.getChannel(doomed.id)).toBeNull();
});
+ it("starts stage two without anyone reading the episode (the background sweep)", async () => {
+ const ep = faceless.createEpisode({ kind: "explainer", topic: "Why bridges sway", settings: { ...cloud, length: 20 }, autoRender: true });
+ await faceless.scriptWritten(ep.id);
+ // Only the row is read from here on: no episodeView, no list.
+ const plan = () => JSON.parse((db().prepare("SELECT plan_json FROM faceless_episodes WHERE id = ?").get(ep.id) as { plan_json: string }).plan_json);
+ expect(plan().awaiting).toBe(true);
+ for (let i = 0; i < 60 && plan().awaiting; i++) await sleep(500);
+ expect(plan().awaiting).toBe(false);
+ expect(Object.keys(plan().ids)).toEqual(expect.arrayContaining(["join", "mix", "captions"]));
+ await faceless.deleteEpisode(ep.id);
+ }, 60_000);
+
it("marks a script that was being written when the server restarted as failed, with Try again", async () => {
const ep = faceless.createEpisode({ kind: "faceless", channelId: channel.id, topic: "The Silk Road", settings: cloud });
await faceless.scriptWritten(ep.id);