import { describe, it, expect, vi, beforeEach } from "vitest"; import { fireEvent, render, screen } from "@testing-library/react"; const mockFocus = vi.hoisted(() => vi.fn()); vi.mock("@tanstack/react-query", () => ({ useQueryClient: () => ({}), })); vi.mock("./extensions", () => ({ createEditorExtensions: () => [], })); vi.mock("./extensions/file-upload", () => ({ uploadAndInsertFile: vi.fn(), })); vi.mock("./utils/preprocess", () => ({ preprocessMarkdown: (value: string) => value, })); vi.mock("./bubble-menu", () => ({ EditorBubbleMenu: () => null, })); vi.mock("@tiptap/react", () => ({ useEditor: () => ({ commands: { focus: mockFocus, clearContent: vi.fn(), }, getMarkdown: () => "", state: { doc: { content: { size: 0, }, }, selection: { empty: true, }, }, }), EditorContent: ({ className }: { className?: string }) => (