import { describe, expect, it, vi } from "vitest"; vi.mock("@/lib/common/clipboard", () => ({ copyRichTextToClipboard: vi.fn().mockResolvedValue(undefined), })); import { copyRichTextToClipboard } from "@/lib/common/clipboard"; import { copySqlAsRichText, renderSqlRichTextHtml } from "@/lib/sql/sqlRichText"; describe("renderSqlRichTextHtml", () => { it("emits token colors as inline styles inside a single pre", async () => { const html = await renderSqlRichTextHtml("SELECT id FROM users;"); expect(html.startsWith('
")).toBe(true);
expect(html).toContain(' {
const html = await renderSqlRichTextHtml("SELECT id FROM users WHERE name = 'ada';");
expect(html).not.toContain("class=");
expect(html).not.toContain("