From b8a329b34bf5187fc16bbb9ea71584ea16d17a8d Mon Sep 17 00:00:00 2001 From: Dotta Date: Sun, 7 Jun 2026 02:59:57 +0000 Subject: [PATCH] Add documentReviewService stub to fix 11 broken server tests (PAP-10578) PAP-10523 added documentReviewService(db) to issueRoutes, but the test scaffolds in document-annotation-routes.test.ts and issue-document-restore-routes.test.ts did not list it in their services mocks, crashing createApp. Stub remapOpenSuggestionsForDocument (the only method the exercised create/restore paths call) to return []. Co-Authored-By: Claude Opus 4.8 --- server/src/__tests__/document-annotation-routes.test.ts | 1 + server/src/__tests__/issue-document-restore-routes.test.ts | 2 ++ 2 files changed, 3 insertions(+) diff --git a/server/src/__tests__/document-annotation-routes.test.ts b/server/src/__tests__/document-annotation-routes.test.ts index 0a2aa0e6784..a2b5aaca857 100644 --- a/server/src/__tests__/document-annotation-routes.test.ts +++ b/server/src/__tests__/document-annotation-routes.test.ts @@ -121,6 +121,7 @@ function registerModuleMocks() { agentService: () => ({ getById: vi.fn(), list: vi.fn(async () => []) }), companyService: () => ({ getById: vi.fn(async () => ({ id: companyId, attachmentMaxBytes: 10_000_000 })) }), documentAnnotationService: () => mockAnnotationService, + documentReviewService: () => ({ remapOpenSuggestionsForDocument: async () => [] }), documentService: () => mockDocumentService, environmentService: () => ({}), executionWorkspaceService: () => ({}), diff --git a/server/src/__tests__/issue-document-restore-routes.test.ts b/server/src/__tests__/issue-document-restore-routes.test.ts index d0fe8df9baa..a29728af249 100644 --- a/server/src/__tests__/issue-document-restore-routes.test.ts +++ b/server/src/__tests__/issue-document-restore-routes.test.ts @@ -90,6 +90,7 @@ function registerModuleMocks() { vi.doMock("../services/documents.js", () => ({ documentAnnotationService: () => ({ remapOpenThreadsForDocument: async () => [] }), + documentReviewService: () => ({ remapOpenSuggestionsForDocument: async () => [] }), documentService: () => mockDocumentsService, })); @@ -116,6 +117,7 @@ function registerModuleMocks() { accessService: () => mockAccessService, agentService: () => mockAgentService, documentAnnotationService: () => ({ remapOpenThreadsForDocument: async () => [] }), + documentReviewService: () => ({ remapOpenSuggestionsForDocument: async () => [] }), documentService: () => mockDocumentsService, executionWorkspaceService: () => ({}), feedbackService: () => ({}),