import { describe, it, expect } from 'vitest' import { ReportSchema } from '@/domain/schema/report' import { generateId } from '@/lib/id' import { todayIso, nowIso } from '@/lib/dates' import { assert } from '@/lib/assert' describe('skeleton smoke test', () => { it('generates a non-empty id', () => { const id = generateId() expect(typeof id).toBe('string') expect(id.length).toBeGreaterThan(0) }) it('todayIso returns an ISO date string', () => { const today = todayIso() expect(today).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/) }) it('ReportSchema parses a valid minimal report', () => { const validReport = { version: 1 as const, id: generateId(), createdAt: nowIso(), date: todayIso(), practitioner: { name: 'Dr. Dupont' }, animal: { speciesId: 'equine', name: 'Mistral' }, owner: { name: 'Jean Martin' }, 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) }) it('assert passes when condition is truthy', () => { expect(() => assert(true, 'should not throw')).not.toThrow() }) it('assert throws when condition is falsy', () => { expect(() => assert(false, 'boom')).toThrow('Assertion failed: boom') }) })