import { describe, expect, it } from 'vitest'; import { safeHtml } from './sanitize'; describe('safeHtml', () => { it('returns empty string for null/undefined/empty input', () => { expect(safeHtml(null)).toBe(''); expect(safeHtml(undefined)).toBe(''); expect(safeHtml('')).toBe(''); }); it('keeps allowed tags: p, strong, em, br, h2, h3, ul, ol, li', () => { const html = '
bold italic
x