From 24c6675c8218a58f846f56619923b40b2dc6a043 Mon Sep 17 00:00:00 2001 From: Amit Haridas Date: Fri, 5 Jun 2026 23:17:57 +0530 Subject: [PATCH] fix(test): use mockRejectedValue for IPC error in ExportPdfDialog test --- tests/component/modals/ExportPdfDialog.test.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/component/modals/ExportPdfDialog.test.tsx b/tests/component/modals/ExportPdfDialog.test.tsx index 0189d94..8c180d2 100644 --- a/tests/component/modals/ExportPdfDialog.test.tsx +++ b/tests/component/modals/ExportPdfDialog.test.tsx @@ -35,7 +35,7 @@ describe('ExportPdfDialog', () => { }); it('renders an error banner when IPC fails', async () => { - (window.electronAPI.export.pdf as any).mockResolvedValueOnce({ ok: false, error: { code: 'E', message: 'Pandoc not found' } }); + (window.electronAPI.export.pdf as any).mockRejectedValueOnce(new Error('Pandoc not found')); render(); await userEvent.click(screen.getByRole('button', { name: /^export$/i })); expect(await screen.findByText(/pandoc not found/i)).toBeInTheDocument();