feat: split jídel

feat: graf příjmů
This commit is contained in:
Ondřej Anděl committed 2026-10-09 15:15:04 +02:00
1 parent bc85a37fc0
commit b880b36edd
32 files changed
+2048 -262

No files matched your search

+19
View File
@@ -25,10 +25,29 @@ describe('skupiny jídel podle názvu a zdroje', () => {
name: 'Čína', source: 'Chefie', count: 3, lastDate: '2025-03-03',
missingCaloriesCount: 2, missingWeightCount: 2, missingNutrientsCount: 3,
values: { weight: 400, caloriesPer100g: 150 },
days: [
{ date: '2025-03-03', incomplete: true },
{ date: '2025-03-02', incomplete: true },
{ date: '2025-03-01', incomplete: true },
],
});
expect(groups[1]).toMatchObject({ source: 'doma', count: 1 });
});
it('u dnů skupiny označí ty, kde jídlu něco chybí', async () => {
await addMeal(LOGIN, {
...cina, date: '2025-03-01', weight: 400, caloriesPer100g: 150, nutrientsPer100g: { protein: 8 },
});
await addMeal(LOGIN, { ...cina, date: '2025-03-02', price: 13900 });
const [group] = await getMealGroups(LOGIN);
expect(group.days).toEqual([
{ date: '2025-03-02', incomplete: true },
{ date: '2025-03-01', incomplete: false },
]);
});
it('energii a živiny předvyplní i z jídla stejného názvu odjinud, sazbu ne', async () => {
await addMeal(LOGIN, {
...cina, date: '2025-03-01', source: 'doma', pricePer100g: 2000, caloriesPer100g: 140,