// Unit test for the static legal pages: renderPrivacy / renderEula wrap the owner-edited markdown in // the shared legal-page chrome (bundled renderLegalHtml) with the right title + canonical URL and no // dynamic data. The prose rendering itself is unit-tested in ui/ (offer.test.ts); here we assert the // per-page presets. import test from 'node:test'; import assert from 'node:assert/strict'; import { renderPrivacy, renderEula } from '../src/legal.mjs'; test('renderPrivacy wraps the markdown in the privacy-page chrome', () => { const html = renderPrivacy('# Политика конфиденциальности\n\n**1.1.** ИНН 290210610742.'); assert.ok(html.includes(''), 'a standalone document'); assert.ok(html.includes('Политика конфиденциальности — Эрудит'), 'the privacy title'); assert.ok(html.includes('href="https://erudit-game.ru/privacy/"'), 'the privacy canonical URL'); assert.ok(html.includes('290210610742'), 'the prose reached the document'); }); test('renderEula wraps the markdown in the EULA-page chrome', () => { const html = renderEula('# Лицензионное соглашение\n\nтекст'); assert.ok(html.includes('Пользовательское соглашение — Эрудит'), 'the EULA title'); assert.ok(html.includes('href="https://erudit-game.ru/eula/"'), 'the EULA canonical URL'); });