refactor(shopping): redundanten kg-Check in consolidate() entfernt + Boundary-Test
Some checks failed
Build & Publish Docker Image / build-and-push (push) Has been cancelled

Weight-Branch prueft nicht mehr doppelt auf unitFamily; stil-parity mit Volume-Branch.
Boundary-Test fuer exakt 1000 g ergaenzt (15/15 Tests gruen).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
hsiegeln
2026-04-22 16:53:29 +02:00
parent c6a549699a
commit b85f869c09
2 changed files with 8 additions and 1 deletions

View File

@@ -44,6 +44,13 @@ describe('consolidate', () => {
expect(out).toEqual({ quantity: 500, unit: 'g' });
});
it('promoted bei exakt 1000 g (Boundary)', () => {
const out = consolidate([
{ quantity: 1000, unit: 'g' }
]);
expect(out).toEqual({ quantity: 1, unit: 'kg' });
});
it('kombiniert ml + l analog (400 ml + 0,5 l → 900 ml)', () => {
const out = consolidate([
{ quantity: 400, unit: 'ml' },