36 lines
1.6 KiB
JavaScript
36 lines
1.6 KiB
JavaScript
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)
|
||
}
|
||
})
|