test(app): former PDF, observation card, route and schema assertions restored on v3; foreign JSON attachment reported as no_attachment; doc counts
This commit is contained in:
1 parent
06a2e86f3c
commit
17a6d9b323
9 files changed
+406
-27
No files matched your search
@@ -69,9 +69,9 @@ describe('report v3 leaf schemas', () => {
|
||||
|
||||
it('ObservationSchema rejects an empty id', () => {
|
||||
expect(ObservationSchema.safeParse(observation).success).toBe(true)
|
||||
expect(ObservationSchema.safeParse({ ...observation, id: '' }).success).toBe(
|
||||
false,
|
||||
)
|
||||
expect(
|
||||
ObservationSchema.safeParse({ ...observation, id: '' }).success,
|
||||
).toBe(false)
|
||||
})
|
||||
|
||||
it('SeveritySchema accepts the three codes only', () => {
|
||||
@@ -116,3 +116,27 @@ describe('report v3 document and identity', () => {
|
||||
)
|
||||
})
|
||||
})
|
||||
|
||||
describe('report v3 permissive boundaries', () => {
|
||||
it('strips unknown keys silently', () => {
|
||||
const out = ReportSchema.parse({ ...report, foo: 1 })
|
||||
expect('foo' in out).toBe(false)
|
||||
})
|
||||
|
||||
it('accepts a vertebra index above any region count (bounds are a sheet concern)', () => {
|
||||
expect(VertebraSchema.safeParse({ region: 'C', index: 99 }).success).toBe(
|
||||
true,
|
||||
)
|
||||
})
|
||||
|
||||
it('accepts an unregistered speciesId', () => {
|
||||
const animal = { speciesId: 'dragon', name: 'A' }
|
||||
expect(ReportSchema.safeParse({ ...report, animal }).success).toBe(true)
|
||||
})
|
||||
|
||||
it('accepts orphan findings citing a zone absent from zones (D5)', () => {
|
||||
const orphan = { ...observation, findings: [finding] }
|
||||
const out = ReportSchema.safeParse({ ...report, observations: [orphan] })
|
||||
expect(out.success).toBe(true)
|
||||
})
|
||||
})
|
||||
Reference in new issue
Block a user