feat: KitchenStock light UI, Gemma 31B AI, supermarket store filters & 130+ vegan products

This commit is contained in:
KitchenStock
2026-07-26 20:08:16 +02:00
commit 83fcf6909c
81 changed files with 17001 additions and 0 deletions
+54
View File
@@ -0,0 +1,54 @@
import { describe, it, expect } from 'vitest';
import { MockKitchenAiProvider } from '@/lib/ai/client';
describe('MockKitchenAiProvider (No Billing Test)', () => {
const provider = new MockKitchenAiProvider();
it('suggests recipes with expected structured outputs', async () => {
const recipes = await provider.suggestRecipes({
householdId: 'test-household',
inventory: [
{
id: 'prod-1',
householdId: 'test-household',
categoryId: null,
defaultLocationId: null,
defaultUnitId: null,
name: 'Reis',
brand: null,
description: null,
barcode: null,
imagePath: null,
packageSize: 1000,
packageUnit: 'g',
minimumQuantity: 100,
favorite: true,
preferredStore: null,
estimatedPriceCents: 249,
priceUpdatedAt: null,
archived: false,
totalQuantity: 1000,
stockValueCents: 249,
isLowStock: false,
isExpiringSoon: false,
earliestExpirationDate: null,
},
],
});
expect(recipes).toHaveLength(1);
expect(recipes[0].title).toBeDefined();
expect(recipes[0].inventoryCoveragePercent).toBeGreaterThan(0);
});
it('returns verified price searches via Mock Provider', async () => {
const price = await provider.searchPrices({
householdId: 'test-household',
query: 'Spaghetti',
retailer: 'REWE',
});
expect(price.priceCents).toBe(189);
expect(price.confidence).toBe('HIGH');
});
});