import { sanitizeHtml, sanitizeSvg } from "./Sanitize"; // Mock the dynamic import for DOMPurify jest.mock("@/Core/DynamicImports", () => ({ dynamicImports: { dompurify: { get module() { // Return a mock DOMPurify object return Promise.resolve({ sanitize: (input: string, config?: any) => { // A simplified mock that mimics the real library for testing purposes. // It removes script tags and event handlers. if (typeof input !== "string") return ""; let sanitized = input.replace( / World
'; const sanitized = await sanitizeHtml(unsafeHtml); expect(sanitized).not.toContain("