import { describe, expect, test } from 'bun:test'; await import('../jsdom'); const { sanitizeHTML } = await import('../../src/utils/sanitize'); describe('sanitizeHTML', () => { test('keeps allowed tags and attributes', () => { let html = '

Hello world! bsky.app

'; expect(sanitizeHTML(html)).toBe(html); }); test('removes disallowed tags while keeping their text content', () => { let html = '

Hello code x

'; expect(sanitizeHTML(html)).toBe('clik

Hello code x

'); }); test('removes disallowed attributes', () => { let html = '

Hi

'; expect(sanitizeHTML(html)).toBe('

Hi

'); }); test('removes unsafe link URLs', () => { expect(sanitizeHTML('x')).toBe('x'); }); });