Gaestetexte/Datenschutz: Storno-Regel im Archiv, PDF-Pruefsumme, PDF-Kopfpruefung

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
ClaudeandClaude Sonnet 5.5 committed 2026-10-05 05:03:54 +00:00
1 parent 9a2a70b491
commit ec320853ce
13 files changed
+124 -12

No files matched your search

+37
View File
@@ -1559,6 +1559,43 @@ test('textform_pflicht_modus_on: fremdes Projekt, Kundensitzung und nicht lesbar
assert.equal((await aktivierenF13(k, feldF13(k))).status, 200)
})
test('textform_pflicht_modus_on: eine leere oder keine PDF-Datei als Unterlage ergibt 503 vor jeder Änderung (R121), danach mit gültigen Dateien 200', async (t) => {
modusMerken(t)
termineMit('on', [])
const fs = await import('node:fs')
const os = await import('node:os')
const path = await import('node:path')
const { legalPdfFiles } = await import('../server/services/legalDocs.js')
const echt = legalPdfFiles('termine', config.termine.avvVersion)
const kopien = fs.mkdtempSync(path.join(os.tmpdir(), 'f13-pdf-'))
fs.mkdirSync(path.join(kopien, 'rechtliches'))
const kopiere = () => {
for (const f of Object.values(echt)) fs.copyFileSync(f.path, path.join(kopien, 'rechtliches', path.basename(f.path)))
}
t.after(() => {
setLegalDirForTests(null)
fs.rmSync(kopien, { recursive: true, force: true })
})
setLegalDirForTests(kopien)
const k = legeKundeF13()
const mailsVorher = mails.sent.length
for (const [doc, inhalt] of [['lb', ''], ['avv', '<html>kein PDF</html>'], ['lb', '%PDF']]) {
kopiere()
fs.writeFileSync(path.join(kopien, 'rechtliches', path.basename(echt[doc].path)), inhalt)
const res = await aktivierenF13(k, feldF13(k))
assert.equal(res.status, 503, `${doc}: ${JSON.stringify(inhalt)}`)
assert.match(res.body.error, /Rechtsunterlagen/)
assert.equal(await sf.getFeatureDoc(k.customerId, k.projectId, 'termine'), null, 'nichts angelegt')
assert.equal(consentsDesF13(k.projectId).length, 0, 'kein Nachweis')
assert.equal(mails.sent.length, mailsVorher)
}
kopiere()
const ok = await aktivierenF13(k, feldF13(k))
assert.equal(ok.status, 200, JSON.stringify(ok.body))
assert.equal(consentsDesF13(k.projectId).length, 1)
assert.equal(k16AnF13(k.email).length, 1)
})
test('get_admin_termine_feld: GET /api/team/funktionen/:kunde liefert termine { textformNoetig, avvVersion, links } je Modus', async (t) => {
modusMerken(t)
const k = legeKundeF13({ email: 'get-f13@example.invalid' })