import React from "react"; import { describe, expect, it, vi } from "vitest"; import { render, screen } from "@testing-library/react"; import userEvent from "@testing-library/user-event"; import { renderWithI18n } from "../test/i18n"; const longRepoUrl = "https://github.com/multica-ai/a-very-long-repository-name-that-needs-a-tooltip"; const apiRepoUrl = "https://github.com/multica-ai/api"; const webRepoUrl = "https://github.com/multica-ai/web"; vi.mock("@tanstack/react-query", () => ({ useQuery: () => ({ data: [] }), })); vi.mock("@multica/core/projects/mutations", () => ({ useCreateProject: () => ({ mutateAsync: vi.fn() }), })); vi.mock("@multica/core/projects", () => ({ useProjectDraftStore: (selector: (state: unknown) => unknown) => selector({ draft: { title: "", description: "", status: "planned", priority: "medium", leadType: undefined, leadId: undefined, icon: undefined, }, setDraft: vi.fn(), clearDraft: vi.fn(), }), })); vi.mock("@multica/core/hooks", () => ({ useWorkspaceId: () => "workspace-1", })); vi.mock("@multica/core/paths", () => ({ useCurrentWorkspace: () => ({ id: "workspace-1", name: "Test Workspace", slug: "test-workspace", repos: [{ url: longRepoUrl }, { url: apiRepoUrl }, { url: webRepoUrl }], }), useWorkspacePaths: () => ({ projectDetail: (id: string) => `/test-workspace/projects/${id}`, }), })); vi.mock("@multica/core/workspace/queries", () => ({ memberListOptions: () => ({ queryKey: ["members"], queryFn: vi.fn() }), agentListOptions: () => ({ queryKey: ["agents"], queryFn: vi.fn() }), })); vi.mock("@multica/core/workspace/hooks", () => ({ useActorName: () => ({ getActorName: vi.fn() }), })); vi.mock("../navigation", () => ({ useNavigation: () => ({ push: vi.fn() }), })); vi.mock("../editor", () => { const ContentEditor = React.forwardRef( ({ placeholder }, ref) =>