From ae8ac332b42bdbb4cfd655fffb29b1e97af7458d Mon Sep 17 00:00:00 2001 From: Dotta Date: Sun, 7 Jun 2026 03:00:07 +0000 Subject: [PATCH] Add Link mock to IssueDocumentsSection tests (PAP-10579) The PAP-10569 Open-in-Documents change added a from @/lib/router inside IssueDocumentsSection, but the test file's vi.mock("@/lib/router") block only exported useLocation, so all 8 tests crashed during render with "No Link export is defined". Add a passthrough mock for Link. Co-Authored-By: Claude Opus 4.8 --- ui/src/components/IssueDocumentsSection.test.tsx | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ui/src/components/IssueDocumentsSection.test.tsx b/ui/src/components/IssueDocumentsSection.test.tsx index 0ce5cb6627d..5f84382b6e6 100644 --- a/ui/src/components/IssueDocumentsSection.test.tsx +++ b/ui/src/components/IssueDocumentsSection.test.tsx @@ -40,6 +40,11 @@ vi.mock("../hooks/useAutosaveIndicator", () => ({ vi.mock("@/lib/router", () => ({ useLocation: () => ({ hash: "" }), + Link: ({ to, children, ...props }: { to: unknown; children?: unknown } & ComponentProps<"a">) => ( + + {children as ComponentProps<"a">["children"]} + + ), })); vi.mock("./MarkdownBody", () => ({