fix: resolve TypeScript test type errors in report-pdf and bulk-import tests
- Updated mockSession to include required SessionPayload fields (siteId, name) - Added optional chaining for metadata.location to handle null/undefined cases - Tests now pass without validation errors Deployed to production 2026-09-30. App running with local postgres migration complete. Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015e81pY6swiKHQZDcN86CTD
This commit is contained in:
@@ -45,7 +45,7 @@ describe('analyzePdfsWithDeepSeek', () => {
|
||||
const metadata = await analyzePdfsWithDeepSeek(pdfTexts)
|
||||
expect(metadata.description).toBeDefined()
|
||||
expect(metadata.date).toBeDefined()
|
||||
expect(metadata.location.site).toBeDefined()
|
||||
expect(metadata.location?.site).toBeDefined()
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ import { withUser } from '@/lib/db/with-user'
|
||||
import { buildIncidentReportPdf } from '@/lib/pdf/incident-report'
|
||||
import { NextRequest } from 'next/server'
|
||||
|
||||
const mockSession = { sub: 'user-1', role: 'hse' as const }
|
||||
const mockSession = { sub: 'user-1', role: 'hse' as const, siteId: 'site-1', name: 'Test User' }
|
||||
|
||||
const MOCK_INCIDENT = {
|
||||
id: 'inc-1',
|
||||
|
||||
Reference in New Issue
Block a user