import React from "react"; import { renderToStaticMarkup } from "react-dom/server"; import ReactMarkdown from "react-markdown"; import rehypeKatex from "rehype-katex"; import rehypeRaw from "rehype-raw"; import rehypeSanitize from "rehype-sanitize"; import remarkMath from "remark-math"; import { describe, expect, it } from "vitest"; import { SANITIZE_SCHEMA, isTrustedIframeSrc } from "@/components/MemoContent/constants"; type IframeProps = React.ComponentProps<"iframe">; const TrustedIframe = (props: IframeProps) => { if (typeof props.src !== "string" || !isTrustedIframeSrc(props.src)) { return null; } return '); const untrusted = renderMemoContent(''); expect(trusted).toMatch(/