diff --git a/ui/src/App.tsx b/ui/src/App.tsx index 0bc4721b..804e8d48 100644 --- a/ui/src/App.tsx +++ b/ui/src/App.tsx @@ -36,6 +36,7 @@ import { PluginManager } from "./pages/PluginManager"; import { PluginSettings } from "./pages/PluginSettings"; import { AdapterManager } from "./pages/AdapterManager"; import { PluginPage } from "./pages/PluginPage"; +import { IssueChatUxLab } from "./pages/IssueChatUxLab"; import { RunTranscriptUxLab } from "./pages/RunTranscriptUxLab"; import { OrgChart } from "./pages/OrgChart"; import { NewAgent } from "./pages/NewAgent"; @@ -175,6 +176,7 @@ function boardRoutes() { } /> } /> } /> + } /> } /> } /> } /> @@ -347,6 +349,7 @@ export function App() { } /> } /> } /> + } /> } /> }> {boardRoutes()} diff --git a/ui/src/components/IssueChatThread.test.tsx b/ui/src/components/IssueChatThread.test.tsx new file mode 100644 index 00000000..b0cb86ce --- /dev/null +++ b/ui/src/components/IssueChatThread.test.tsx @@ -0,0 +1,123 @@ +// @vitest-environment jsdom + +import { act } from "react"; +import type { ReactNode } from "react"; +import { createRoot } from "react-dom/client"; +import { MemoryRouter } from "react-router-dom"; +import { afterEach, beforeEach, describe, expect, it, vi } from "vitest"; +import { IssueChatThread } from "./IssueChatThread"; + +vi.mock("@assistant-ui/react", () => ({ + AssistantRuntimeProvider: ({ children }: { children: ReactNode }) =>
{children}
, + ThreadPrimitive: { + Root: ({ children, className }: { children: ReactNode; className?: string }) => ( +
{children}
+ ), + Viewport: ({ children, className }: { children: ReactNode; className?: string }) => ( +
{children}
+ ), + Empty: ({ children }: { children: ReactNode }) =>
{children}
, + Messages: () =>
, + }, + MessagePrimitive: { + Root: ({ children }: { children: ReactNode }) =>
{children}
, + Content: () => null, + }, + useAui: () => ({ thread: () => ({ append: vi.fn() }) }), + useAuiState: () => false, + useMessage: () => ({ + id: "message", + role: "assistant", + createdAt: new Date("2026-04-06T12:00:00.000Z"), + content: [], + metadata: { custom: {} }, + status: { type: "complete" }, + }), +})); + +vi.mock("./transcript/useLiveRunTranscripts", () => ({ + useLiveRunTranscripts: () => ({ + transcriptByRun: new Map(), + hasOutputForRun: () => false, + }), +})); + +vi.mock("./MarkdownBody", () => ({ + MarkdownBody: ({ children }: { children: ReactNode }) =>
{children}
, +})); + +vi.mock("./MarkdownEditor", () => ({ + MarkdownEditor: () =>