From 96cb55495e36e2e01b9528a3a5647b1def0e02dd Mon Sep 17 00:00:00 2001 From: hsiegeln <37154749+hsiegeln@users.noreply.github.com> Date: Sun, 19 Apr 2026 15:00:21 +0200 Subject: [PATCH] test(scaler): section_heading ueberlebt Skalierung Co-Authored-By: Claude Sonnet 4.6 --- tests/unit/scaler.test.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tests/unit/scaler.test.ts b/tests/unit/scaler.test.ts index 472ac31..7aca3b5 100644 --- a/tests/unit/scaler.test.ts +++ b/tests/unit/scaler.test.ts @@ -41,4 +41,15 @@ describe('scaleIngredients', () => { const scaled = scaleIngredients([mk(100, 'g', 'Butter')], 1 / 3); expect(scaled[0].quantity).toBe(33); }); + + it('preserves section_heading through scaling', () => { + const input: Ingredient[] = [ + { position: 1, quantity: 200, unit: 'g', name: 'Mehl', note: null, raw_text: '200 g Mehl', section_heading: 'Teig' }, + { position: 2, quantity: null, unit: null, name: 'Ei', note: null, raw_text: 'Ei', section_heading: null } + ]; + const scaled = scaleIngredients(input, 2); + expect(scaled[0].section_heading).toBe('Teig'); + expect(scaled[1].section_heading).toBeNull(); + expect(scaled[0].quantity).toBe(400); + }); });