import { describe, expect, it } from 'vitest';
import { purifyDiplomacyHtml } from '../src/security/diplomacyHtml.js';
describe('diplomacy HTML purification', () => {
it('removes executable markup, unsafe URLs, SVG, MathML, styles, and event handlers', () => {
const dirty = [
'',
'',
'
',
'위험 링크',
'',
'',
'
안전 본문
', ].join(''); const clean = purifyDiplomacyHtml(dirty); expect(clean).toBe('위험 링크SVG안전 본문
'); expect(clean).not.toMatch(/script|onerror|onclick|javascript:|style=|class=|