import { sanitizeHTML, sanitizeInput, sanitizeURL, escapeHTML } from './sanitize'; describe('sanitize', () => { describe('sanitizeHTML', () => { it('should allow safe HTML tags', () => { const result = sanitizeHTML('
Hello world
'); expect(result).toContain(''); expect(result).toContain(''); }); it('should remove dangerous tags', () => { const result = sanitizeHTML('
safe
'); expect(result).not.toContain(''); expect(result).not.toContain('')).toBe(''); }); }); describe('escapeHTML', () => { it('should escape HTML special characters', () => { expect(escapeHTML('