import { buildLegalValidationPrompt, hasEnglishContent } from './legal-validation-prompt' const hu = { title: 'Adatvédelmi Tájékoztató', lastUpdated: '2026. augusztus 22.', sections: [ { id: 'bevezetes', title: '1. Bevezetés', content: 'A mozdIT Bt. mint adatkezelő…' }, { id: 'jogok', title: '5. Az érintettek jogai', content: 'Az érintettek bármikor…' }, ], } const en = { title: 'Privacy Notice', lastUpdated: '22 August 2026', sections: [{ id: 'bevezetes', title: '1. Introduction', content: 'mozdIT Bt., as controller…' }], } describe('buildLegalValidationPrompt (MITHOME-113)', () => { const prompt = buildLegalValidationPrompt(hu, en)! it('should include every review criterion and the output format', () => { for (const text of ['Meaning equivalence', 'GDPR', 'Strength of obligations', 'placeholders', 'Severity (high / medium / low)', 'APPROVE WITH CHANGES', 'not legal advice']) { expect(prompt).toContain(text) } }) it('should pair every Hungarian section with its English section by id', () => { expect(prompt).toContain('--- Section 1 (bevezetes) ---\n[HU] 1. Bevezetés\nA mozdIT Bt. mint adatkezelő…\n[EN] 1. Introduction\nmozdIT Bt., as controller…') expect(prompt).toContain('Document (EN): Privacy Notice') }) it('should flag a missing English section as high severity', () => { expect(prompt).toContain('--- Section 2 (jogok) ---') expect(prompt).toMatch(/\[EN\] \(missing — report as high severity\)\n\(missing — report as high severity\)$/) }) it('should return undefined when there is no English text', () => { expect(buildLegalValidationPrompt(hu, { title: ' ', sections: [{ id: 'bevezetes', title: null, content: '' }] })).toBeUndefined() expect(hasEnglishContent({})).toBe(false) }) })