Add case adjudication cutscene
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { describe, expect, it } from 'vitest'
|
||||
import { resolvePoseAssetId } from './narrativeRepository.js'
|
||||
import { buildAdjudicationPresentation, resolvePoseAssetId } from './narrativeRepository.js'
|
||||
|
||||
describe('resolvePoseAssetId', () => {
|
||||
const poses = { neutral: 'asset-neutral', concerned: 'asset-concerned', missing: null }
|
||||
@@ -19,3 +19,25 @@ describe('resolvePoseAssetId', () => {
|
||||
expect(resolvePoseAssetId({}, 'neutral', 'neutral')).toBeNull()
|
||||
})
|
||||
})
|
||||
|
||||
describe('buildAdjudicationPresentation', () => {
|
||||
it('presents only evidence accepted by the submitted report', () => {
|
||||
const presentation = buildAdjudicationPresentation({
|
||||
title: 'Barricelli Inventor Finding', investigatorName: 'Mutable byline', requiredForCompletion: true,
|
||||
status: 'accepted', issues: [], claims: [{ claimExhibitId: 'claim-1', statement: 'Nils Aall Barricelli was an inventor.', evidence: [
|
||||
{ connectionId: 'connection-1', documentExhibitId: 'document-1', displayNumber: 1, documentTitle: 'Patent record', fileType: 'image',
|
||||
relationText: 'Proves that Barricelli filed a patent.', publishedAt: '1953-08-19T00:00:00.000Z', sourceCitation: 'Google Patents', sourceUri: 'https://patents.example/1',
|
||||
evidenceAccepted: true, verification: { status: 'accepted', detail: 'Matched.' } },
|
||||
{ connectionId: 'connection-2', documentExhibitId: 'document-2', displayNumber: 2, documentTitle: 'Unverified image', fileType: 'image',
|
||||
relationText: 'Maybe related.', evidenceAccepted: false, verification: { status: 'not_evaluated', detail: 'Not checked.' } },
|
||||
] }],
|
||||
}, { investigatorName: 'Ada Investigator', submittedAt: new Date('2026-08-23T12:00:00.000Z') })
|
||||
|
||||
expect(presentation).toMatchObject({
|
||||
kind: 'case-adjudication', investigatorName: 'Ada Investigator', submittedAt: '2026-08-23T12:00:00.000Z',
|
||||
finding: 'SUPPORTED BY THE SUBMITTED EVIDENCE', stampText: 'CASE VERIFIED',
|
||||
claims: [{ statement: 'Nils Aall Barricelli was an inventor.', evidence: [{ displayNumber: 1, title: 'Patent record' }] }],
|
||||
})
|
||||
expect(presentation.claims[0].evidence).toHaveLength(1)
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user