import assert from 'node:assert/strict'
import test from 'node:test'
import { protectProviderImageSrcInHTML } from './security.ts'
test('protectProviderImageSrcInHTML uses a placeholder src for provider images', () => {
const html = '

'
const sanitized = protectProviderImageSrcInHTML(html)
const renderedSrc = sanitized.match(/
]*\ssrc="([^"]+)"/)?.[1]
assert.match(renderedSrc || '', /^data:image\/gif;base64,/)
assert.match(sanitized, /data-protected-src="local:\/\/10000\/exports\/a\.jpg"/)
})