diff --git a/src/components/__tests__/AddProductDialog.test.tsx b/src/components/__tests__/AddProductDialog.test.tsx index d10ed3a..51040a7 100644 --- a/src/components/__tests__/AddProductDialog.test.tsx +++ b/src/components/__tests__/AddProductDialog.test.tsx @@ -57,7 +57,7 @@ describe('AddProductDialog', () => { }); it('applies initialBarcode and triggers lookup', async () => { - fetchProductSpy.mockResolvedValue({ name: 'From OFF' }); + fetchProductSpy.mockResolvedValue({ name: 'From OFF', source: 'openfoodfacts' }); render( ({ @@ -18,20 +19,23 @@ const categoriesById = new Map([ ['cat-2', 'Drinks'], ]); -const baseProduct = { +const baseProduct: Product = { id: 'p1', name: 'Product One', category: 'cat-1', unit_type: 'unit', bulk_name: 'carton', + barcode: undefined, archived: false, created_at: 0, updated_at: 0, }; describe('ProductRow error handling', () => { - let onSave: ReturnType; - let onDelete: ReturnType; + let onSave: ReturnType< + typeof vi.fn<(productId: string, updates: { name: string; category: string; barcode?: string }) => void> + >; + let onDelete: ReturnType void>>; beforeEach(() => { onSave = vi.fn();