import { test } from '@japa/runner'
import DOMPurify from '../../../src/lib/dom_purify.js'

test('DOMPurify is initialized correctly', ({ assert }) => {
  assert.isFunction(DOMPurify.sanitize, 'DOMPurify should have a sanitize function')
})

test('DOMPurify sanitizes input correctly', ({ assert }) => {
  const unsafeInput = '<script>alert("XSS")</script>'
  const safeOutput = DOMPurify.sanitize(unsafeInput)
  assert.equal(safeOutput, '', 'Sanitized output should be empty for unsafe input')
})
