Add case adjudication cutscene

This commit is contained in:
2026-08-23 23:21:24 +02:00
parent 0c4e0db118
commit 31a4b52832
13 changed files with 330 additions and 33 deletions
+23 -1
View File
@@ -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)
})
})