/** @jest-environment jsdom */ const path = require('path'); // Load sanitizer utility first so alerts can delegate to it require(path.join(__dirname, '..', 'sanitizer.js')); // Load the alerts module (IIFE attaches itself to window) require(path.join(__dirname, '..', 'alerts.js')); describe('alerts._sanitize', () => { const sanitize = window.alerts && window.alerts._sanitize; it('should be a function', () => { expect(typeof sanitize).toBe('function'); }); it('removes

Hello

'; const clean = sanitize(dirty); expect(clean).toContain(''); expect(clean).toContain('

Hello

'); expect(clean).not.toMatch(/