feat(cms): require multi-model validation before approving legal translations (MITHOME-113)
Legal pages get a sidebar "legal validation" record (validating models, date, report reference). Their English translation status can only be set to "approved" when at least two distinct models, the date and the report are recorded; page globals are unaffected. The admin description states that model review does not replace legal advice. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
822646a82a
commit
329e2e3403
@@ -0,0 +1,25 @@
|
||||
import { missingLegalValidation, validateLegalApproval } from './legal-validation'
|
||||
|
||||
const complete = { models: ['Claude Fable 5.1', 'Claude Opus 5.5'], validatedAt: '2026-09-29', reportRef: 'docs/legal-translation-validation.md' }
|
||||
|
||||
describe('legal approval rule (MITHOME-113)', () => {
|
||||
it('should accept a complete validation record', () => {
|
||||
expect(missingLegalValidation(complete)).toBeUndefined()
|
||||
expect(validateLegalApproval('approved', { siblingData: { legalValidation: complete } })).toBe(true)
|
||||
})
|
||||
|
||||
it.each([
|
||||
[{ ...complete, models: ['Claude Opus 5.5'] }, 'validáló modell'],
|
||||
[{ ...complete, models: ['Claude Opus 5.5', ' Claude Opus 5.5 '] }, 'validáló modell'],
|
||||
[{ ...complete, validatedAt: null }, 'dátuma'],
|
||||
[{ ...complete, reportRef: ' ' }, 'riport'],
|
||||
[undefined, 'validáló modell'],
|
||||
])('should reject approval when the record is incomplete (%#)', (record, missing) => {
|
||||
const result = validateLegalApproval('approved', { siblingData: { legalValidation: record } })
|
||||
expect(result).toEqual(expect.stringContaining(missing))
|
||||
})
|
||||
|
||||
it.each(['none', 'ai-draft', undefined])('should not require a record for status %s', (status) => {
|
||||
expect(validateLegalApproval(status, { siblingData: {} })).toBe(true)
|
||||
})
|
||||
})
|
||||
Reference in New Issue
Block a user