Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions lib/agents/content/__tests__/parseContentPrompt.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,37 @@ describe("parseContentPrompt", () => {
expect(result.songs).toEqual(["hiccups"]);
});

it("extracts artistName from prompt when specified", async () => {
const flags: ContentPromptFlags = {
lipsync: false,
batch: 1,
captionLength: "short",
upscale: false,
template: "artist-caption-bedroom",
artistName: "Mac Miller",
};
mockGenerate.mockResolvedValue({ output: flags });

const result = await parseContentPrompt("make a video for Mac Miller");

expect(result.artistName).toBe("Mac Miller");
});

it("returns undefined artistName when no artist mentioned", async () => {
const flags: ContentPromptFlags = {
lipsync: false,
batch: 1,
captionLength: "short",
upscale: false,
template: "artist-caption-bedroom",
};
mockGenerate.mockResolvedValue({ output: flags });

const result = await parseContentPrompt("make me a video");

expect(result.artistName).toBeUndefined();
});

it("returns undefined songs when no songs mentioned", async () => {
const flags: ContentPromptFlags = {
lipsync: false,
Expand Down
Loading
Loading