From d2dbc7d3a7c034efd894da11ddb9532313d4fc79 Mon Sep 17 00:00:00 2001 From: xiaoxia Date: Fri, 4 Sep 2026 14:08:36 +0800 Subject: [PATCH] fix: add recomputeDedup mock to ProductLibrary test PR #1685 added recomputeDedup to @/api/products but the test mock in ProductLibrary.test.tsx was missing it, causing the component to receive undefined and crash during Vitest runs. Added recomputeDedup mock returning { enqueued: 0, ... } to fix the Frontend Unit Tests CI check. --- apps/web/src/test/pages/ProductLibrary.test.tsx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/apps/web/src/test/pages/ProductLibrary.test.tsx b/apps/web/src/test/pages/ProductLibrary.test.tsx index d157b1d04..cd02bde8e 100644 --- a/apps/web/src/test/pages/ProductLibrary.test.tsx +++ b/apps/web/src/test/pages/ProductLibrary.test.tsx @@ -117,6 +117,9 @@ vi.mock("@/api/products", () => ({ updateReviewStatus: vi.fn().mockResolvedValue({ items: [], total: 0, success: true }), batchDownload: vi.fn().mockResolvedValue({ items: [], total: 0, success: true }), getBatchDownloadStatus: vi.fn().mockResolvedValue({ items: [], total: 0, success: true }), + recomputeDedup: vi + .fn() + .mockResolvedValue({ enqueued: 0, total_scanned: 0, skipped: 0, message: "" }), })) vi.mock("@/pages/products/ProductLibrary.css", () => ({})) -- 2.54.0