import { describe, it, expect } from 'vitest' import { isPlaceholder, legal } from '@/config/legal' describe('isPlaceholder', () => { it('erkennt Platzhalter im Format [NAME]', () => { expect(isPlaceholder('[POSTADRESSE]')).toBe(true) expect(isPlaceholder('[RECHTLICHER NAME DES BETREIBERS]')).toBe(true) }) it('erkennt echte Werte als Nicht-Platzhalter', () => { expect(isPlaceholder('Musterstrasse 1, 8000 Zürich')).toBe(false) expect(isPlaceholder('app@lageplan.ch')).toBe(false) }) it('leere Werte gelten als Platzhalter (fehlend)', () => { expect(isPlaceholder('')).toBe(true) expect(isPlaceholder(null)).toBe(true) expect(isPlaceholder(undefined)).toBe(true) }) }) describe('legal config', () => { it('führt genau 5 Rechtsdokumenttypen', () => { expect(Object.keys(legal.documents).sort()).toEqual( ['dataProcessingAgreement', 'organizationDeclaration', 'privacy', 'responsibleUse', 'terms'] ) }) it('listet nur real genutzte Subprozessoren (keine erfundenen wie Google Analytics)', () => { const names = legal.processors.map(p => p.name.toLowerCase()) expect(names.some(n => n.includes('stripe'))).toBe(true) expect(names.some(n => n.includes('analytics'))).toBe(false) expect(names.some(n => n.includes('mapbox'))).toBe(false) }) })