Fresh history cut from cynarAI/evoo antigravity-handoff/project-timeline (Voice First + project timeline). Brand docs/titles as evOo; keep @rakazo/* packages as tech debt. Excludes node_modules, caches, secrets, voice blobs.
38 lines
1.1 KiB
TypeScript
38 lines
1.1 KiB
TypeScript
import { describe, expect, it } from "vitest";
|
|
import type { PrismaClient } from "@rakazo/db";
|
|
import { createProject } from "./create-project.js";
|
|
|
|
describe("createProject", () => {
|
|
it("requires a non-empty project name", async () => {
|
|
const result = await createProject({ prisma: {} as PrismaClient }, {
|
|
actor: {
|
|
userId: "user-1",
|
|
spaceId: "space-1",
|
|
email: "user@example.test",
|
|
isDeploymentOwner: false,
|
|
},
|
|
createdByBotId: "bot-a",
|
|
name: " ",
|
|
botIds: ["bot-b"],
|
|
});
|
|
expect(result).toEqual({ error: "Project name is required." });
|
|
});
|
|
|
|
it("requires at least two agents including the creator", async () => {
|
|
const result = await createProject({ prisma: {} as PrismaClient }, {
|
|
actor: {
|
|
userId: "user-1",
|
|
spaceId: "space-1",
|
|
email: "user@example.test",
|
|
isDeploymentOwner: false,
|
|
},
|
|
createdByBotId: "bot-a",
|
|
name: "Website Redesign",
|
|
botIds: [],
|
|
});
|
|
expect(result).toEqual({
|
|
error: "At least 2 agents are required. Include bot_id values for other teammates.",
|
|
});
|
|
});
|
|
});
|