/* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ import test from 'node:test'; import assert from 'node:assert/strict'; import { renderTextContent } from './renderTextContent'; test('escapes html tags and script payloads', () => { const rendered = renderTextContent(''); assert.ok(rendered.includes('<img src=x onerror=alert(1)>')); assert.ok(rendered.includes('<script>alert("xss")</script>')); assert.ok(!rendered.includes('