test(documents): mock content-index lookup and pair new animations with motion-reduce

The PATCH detail route now reads the content-index provenance, so its route
test mocks documentContentIndex.findUnique; the searchable status spinner and
the Read-with-AI pulse pair with motion-reduce:animate-none per the coverage
guard.
This commit is contained in:
Marc-André Bombeck committed 2026-07-08 21:41:49 +02:00
1 parent 11fd48cc0e
commit 0b973f4f76
3 files changed
+14 -2

No files matched your search

@@ -22,6 +22,9 @@ vi.mock("@/lib/db", () => ({
deleteMany: vi.fn(),
createMany: vi.fn(),
},
documentContentIndex: {
findUnique: vi.fn(),
},
illnessEpisode: {
findMany: vi.fn(),
},
@@ -131,6 +134,9 @@ beforeEach(() => {
vi.mocked(prisma.documentConditionLink.createMany).mockResolvedValue({
count: 0,
} as never);
vi.mocked(prisma.documentContentIndex.findUnique).mockResolvedValue(
null as never,
);
});
describe("PATCH /api/documents/inbound/[id]", () => {