import { renderToStaticMarkup } from "react-dom/server";
import ReactMarkdown from "react-markdown";
import remarkGfm from "remark-gfm";
import { List, ListItem } from "@/components/MemoContent/markdown";
import { TASK_LIST_CLASS, TASK_LIST_ITEM_CLASS } from "@/components/MemoContent/constants";
import { remarkSplitMixedTaskLists } from "@/utils/remark-plugins/remark-split-mixed-task-lists";
import { describe, expect, it } from "vitest";
const renderListContent = (content: string): string =>
renderToStaticMarkup(
{children}
,
li: ({ children, ...props }) =>
milk
'); expect(html).toContain(TASK_LIST_ITEM_CLASS); expect(html).toContain("grid grid-cols-[auto_minmax(0,1fr)] items-start gap-x-2"); expect(html).toContain('{ const html = renderListContent("- [ ] pickup package\n- [ ] library returns"); expect(html).toMatch(/
{ const html = renderListContent("- [ ] asdas\n - [ ] zzzz"); expect(html).toContain("grid grid-cols-[auto_minmax(0,1fr)] items-start gap-x-2"); expect(html).toContain('
plan
"); expect(html).toContain("keep details
"); expect(html).toContain("zzzz"); }); it("keeps inline task markdown in the task body", () => { const html = renderListContent("- [ ] Northern Lights in Iceland — booking this for winter, *finally*"); expect(html).toContain(''); expect(html).toContain( '