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 <noreply@anthropic.com>
This commit is contained in:
DottaandClaude Opus 4.8 committed 2026-06-07 02:59:57 +00:00
1 parent 0f0bb8e107
commit b8a329b34b
2 files changed
+3

No files matched your search

@@ -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: () => ({}),
@@ -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: () => ({}),