// @vitest-environment jsdom import type { ComponentProps, ReactNode } from "react"; import { act } from "react"; import { createRoot } from "react-dom/client"; import { expect, it, vi } from "vitest"; const api = vi.hoisted(() => ({ list: vi.fn(), create: vi.fn(), get: vi.fn() })); vi.mock("../lib/rpc", () => ({ rpc: { agentSkills: api, memory: { list: async () => [] } }, })); vi.mock("../lib/artifact-open", () => ({ downloadArtifactBytes: vi.fn() })); vi.mock("@lingui/react/macro", () => { const t = (parts: TemplateStringsArray) => parts.join(""); return { useLingui: () => ({ t }), Trans: ({ children }: { children: ReactNode }) => children }; }); vi.mock("@rakazo/ui-web", () => { const Container = ({ children }: { children?: ReactNode }) =>
{children}
; return { Button: ({ variant: _variant, ...props }: ComponentProps<"button"> & { variant?: string }) => (