diff --git a/apps/web/src/components/ComposerPromptEditorTiptap.citationDraft.test.tsx b/apps/web/src/components/ComposerPromptEditorTiptap.citationDraft.test.tsx new file mode 100644 index 0000000000000000000000000000000000000000..81abba7e0d2093717d157f49129aad4007b0469f --- /dev/null +++ b/apps/web/src/components/ComposerPromptEditorTiptap.citationDraft.test.tsx @@ -0,0 +1,123 @@ +// @vitest-environment jsdom + +import { EnvironmentId, MessageId, ThreadId } from "@t3tools/contracts"; +import { + serializeAssistantCitation, + withAssistantCitationComment, +} from "@t3tools/shared/assistantCitations"; +import { act, createRef, useState, type ReactNode } from "react"; +import { createRoot, type Root } from "react-dom/client"; +import { afterEach, beforeEach, expect, it, vi } from "vite-plus/test"; + +import type { AssistantCitationSourceAnchor } from "~/lib/assistantTextSelection"; + +vi.mock("./chat/AssistantCitationSource", () => ({ + observeAssistantCitationCommentSource: () => () => {}, +})); +vi.mock("@tanstack/react-router", () => ({ + useNavigate: () => () => {}, + Link: ({ children }: { children: ReactNode }) => {children}, +})); +// Keep the real chip and comment editor while replacing floating layers. +vi.mock("./ui/popover", () => ({ + Popover: ({ children }: { children: ReactNode }) => <>{children}, + PopoverTrigger: ({ "aria-label": label }: { "aria-label": string }) => ( +