diff --git a/client/src/components/Chat/Messages/Content/Parts/__tests__/ArtifactRouting.test.tsx b/client/src/components/Chat/Messages/Content/Parts/__tests__/ArtifactRouting.test.tsx index 4b6c93ae92..305c117532 100644 --- a/client/src/components/Chat/Messages/Content/Parts/__tests__/ArtifactRouting.test.tsx +++ b/client/src/components/Chat/Messages/Content/Parts/__tests__/ArtifactRouting.test.tsx @@ -11,6 +11,11 @@ jest.mock('~/hooks', () => ({ () => (key: string): string => key, + /* `FileAttachment` calls this hook unconditionally to bridge the + * two-phase preview lifecycle into the attachment cache. The + * routing tests don't exercise the preview flow itself — stub it + * to a no-op so it doesn't blow up jsdom rendering. */ + useAttachmentPreviewSync: () => ({ status: 'ready', previewError: undefined, isPolling: false }), })); jest.mock('../LogLink', () => ({ diff --git a/client/src/components/Chat/Messages/Content/Parts/__tests__/TextAttachment.test.tsx b/client/src/components/Chat/Messages/Content/Parts/__tests__/TextAttachment.test.tsx index c5a8369796..fcadf31005 100644 --- a/client/src/components/Chat/Messages/Content/Parts/__tests__/TextAttachment.test.tsx +++ b/client/src/components/Chat/Messages/Content/Parts/__tests__/TextAttachment.test.tsx @@ -13,6 +13,10 @@ jest.mock('~/hooks', () => ({ }; return translations[key] ?? key; }, + /* `FileAttachment` calls this hook unconditionally to bridge the + * two-phase preview lifecycle. Stub to a no-op for tests that + * don't exercise the preview flow. */ + useAttachmentPreviewSync: () => ({ status: 'ready', previewError: undefined, isPolling: false }), })); const mockHandleDownload = jest.fn();