feat(app): application on the canonical sheet — report v3 store with v2 draft migration, bundled SheetProvider (SHEET_BUNDLE), annotation layer rendered from the document, zone interaction service, pickers and cards on the sheet index, PDF v3 export with v2 archive import; legacy registry, matchers, editors and assets removed
This commit is contained in:
1 parent
0a17e390cf
commit
ce2ec26112
114 files changed
+3560
-14637
No files matched your search
@@ -1,5 +1,5 @@
|
||||
import { describe, it, expect } from 'vitest'
|
||||
import { ReportSchema } from '@/domain/schema/report'
|
||||
import { ReportSchema } from '@faunosteo/domain'
|
||||
import { generateId } from '@/lib/id'
|
||||
import { todayIso, nowIso } from '@/lib/dates'
|
||||
import { assert } from '@/lib/assert'
|
||||
@@ -12,37 +12,32 @@ describe('skeleton smoke test', () => {
|
||||
})
|
||||
|
||||
it('todayIso returns an ISO date string', () => {
|
||||
const today = todayIso()
|
||||
expect(today).toMatch(/^\d{4}-\d{2}-\d{2}$/)
|
||||
expect(todayIso()).toMatch(/^\d{4}-\d{2}-\d{2}$/)
|
||||
})
|
||||
|
||||
it('nowIso returns an ISO timestamp string', () => {
|
||||
const now = nowIso()
|
||||
expect(now).toMatch(/^\d{4}-\d{2}-\d{2}T/)
|
||||
expect(nowIso()).toMatch(/^\d{4}-\d{2}-\d{2}T/)
|
||||
})
|
||||
|
||||
it('ReportSchema parses a valid minimal report', () => {
|
||||
const validReport = {
|
||||
version: 2 as const,
|
||||
it('ReportSchema parses a valid minimal v3 report', () => {
|
||||
const result = ReportSchema.safeParse({
|
||||
version: 3,
|
||||
id: generateId(),
|
||||
createdAt: nowIso(),
|
||||
date: todayIso(),
|
||||
practitioner: { name: 'Dr. Dupont' },
|
||||
animal: { speciesId: 'equine', name: 'Mistral' },
|
||||
owner: { name: 'Jean Martin' },
|
||||
sheet: { sheetId: 's', versionId: null, documentSha256: 'a'.repeat(64) },
|
||||
observations: [],
|
||||
conclusion: '',
|
||||
recommendations: '',
|
||||
}
|
||||
|
||||
const result = ReportSchema.safeParse(validReport)
|
||||
})
|
||||
expect(result.success).toBe(true)
|
||||
})
|
||||
|
||||
it('ReportSchema rejects a report missing required fields', () => {
|
||||
const invalid = { version: 1, id: '' }
|
||||
const result = ReportSchema.safeParse(invalid)
|
||||
expect(result.success).toBe(false)
|
||||
expect(ReportSchema.safeParse({ version: 1, id: '' }).success).toBe(false)
|
||||
})
|
||||
|
||||
it('assert passes when condition is truthy', () => {
|
||||
|
||||
Reference in new issue
Block a user