Files
Webklar-Kundenbereich/test/avvPage.test.js
T

36 lines
1.6 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import { test } from 'node:test'
import assert from 'node:assert/strict'
import { existsSync, readFileSync } from 'node:fs'
const root = (rel) => new URL(`../${rel}`, import.meta.url)
test('AVV Website-Analyse: öffentliche Seite existiert, trägt Fassung und Entwurfshinweis, keine internen Kommentare', () => {
const file = root('public/rechtliches/avv-website-analyse.html')
assert.ok(existsSync(file))
const html = readFileSync(file, 'utf8')
// Die Entwurfsseite nennt noch Fassung 2026-10-01; Task 6 ersetzt sie durch die geprüfte Fassung 2026-10-02
assert.ok(html.includes('Fassung 2026-10-01'))
assert.match(html, /Entwurf – vor Verwendung anwaltlich prüfen lassen/)
assert.doesNotMatch(html, /<!--/)
assert.match(html, /<h2>12\. Haftung/)
})
test('AVV-Link im Portal zeigt auf eine vorhandene Datei unter public/', () => {
const fn = readFileSync(root('public/funktionen.js'), 'utf8')
const url = fn.match(/const AVV_URL = '([^']+)'/)?.[1]
assert.equal(url, '/rechtliches/avv-website-analyse.html')
assert.ok(existsSync(root(`public${url}`)))
})
test('Portal: Dev-Modus-Hinweis an der Analyse-Kachel', () => {
const fn = readFileSync(root('public/funktionen.js'), 'utf8')
assert.match(fn, /Im Dev-Modus wird nicht gemessen/)
assert.match(fn, /a\.devMode/)
})
test('Texte: Akzentfarbe wird beim Einschalten gewählt (kein späteres Portal-Setting behauptet)', () => {
for (const f of ['docs/rechtliches/avv-website-analyse.md', 'docs/rechtliches/leistungsbeschreibung-website-analyse.md']) {
assert.match(readFileSync(root(f), 'utf8'), /beim Einschalten gewählt/, f)
}
})