import { test } from 'node:test' import assert from 'node:assert/strict' import { sichtbarerText, ohneKopf, ladeAlteApp } from './support/knWortlautOrakel.js' import { aboAntwort, abo, VORSCHAU, LIMITS } from './support/knDaten.js' test('sichtbarerText: Tags, Skripte und jeder Leerraum fallen weg, Entitäten werden Text', () => { assert.equal(sichtbarerText('
Hallo Welt & Co
'), 'HalloWelt&Co') assert.equal(sichtbarerText('50,00 € '), '50,00€') }) test('ohneKopf streicht nur den Kopf, nicht die Absätze danach', () => { assert.equal(sichtbarerText(ohneKopf('B
C
')), 'C') assert.equal(sichtbarerText(ohneKopf('C
')), 'C') assert.equal(sichtbarerText(ohneKopf('C
')), 'C') }) test('altes app.js rendert in der VM: Bestellen, Wechsel, Speicher, Gutschrift', async () => { const alt = ladeAlteApp() assert.match(sichtbarerText(alt.bestellen(aboAntwort(), 'wartung')), /Zahlungspflichtigbestellen/) const hosting = aboAntwort({ subscription: abo({ produkt: 'hosting', canSwitch: true }) }) assert.match(sichtbarerText(await alt.wechsel(hosting, VORSCHAU)), /Zahlungspflichtigbestellen/) assert.match(sichtbarerText(await alt.speicher(aboAntwort({ subscription: abo() }))), /E-Mail-Speicher/) assert.match(sichtbarerText(await alt.gutschrift(aboAntwort({ subscription: abo() }), { requests: [], limits: LIMITS })), /Antragabsenden/) })