Initial commit: CookIT recipe collection and week planner

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
CedricandClaude Opus 5.5 committed 2026-10-28 22:55:09 +01:00
commit 7d7a0bc60b
173 files changed
+22803

No files matched your search

+35
View File
@@ -0,0 +1,35 @@
import 'package:cookit/src/recipes/ingredients_text.dart';
import 'package:cookit/src/recipes/models/recipe.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:intl/date_symbol_data_local.dart';
import '../support/fixtures.dart';
void main() {
setUpAll(() => initializeDateFormatting('de'));
String label(String key) => {'gram': 'g', 'tablespoon': 'EL'}[key]!;
test('one Ingredient Line per line, groups separated by an empty line', () {
expect(
ingredientsAsText(recipe().ingredientGroups, label),
'300 g Mehl\n'
'2–3 EL Olivenöl (gutes)\n'
'\n'
'Rosmarin',
);
});
test('scaled amounts and empty groups', () {
final groups = [
const IngredientGroup(lines: []),
const IngredientGroup(lines: [IngredientLine(amount: 1, name: 'Ei')]),
];
expect(
ingredientsAsText([
for (final g in groups) IngredientGroup(lines: [for (final l in g.lines) l.scaled(1.5)]),
], label),
'1½ Ei',
);
});
}