feat(planner): replace Variationskonflikt with red delta badge

Shows the actual score delta (e.g. "↓ -1.5 Punkte") in red instead of a
generic ⚠ Variationskonflikt label, letting users compare the cost of each
recipe to make an informed swap decision.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-04-09 12:50:03 +02:00
committed by marcel
parent e9dc04b2a5
commit da21a12222
2 changed files with 7 additions and 6 deletions

View File

@@ -47,11 +47,12 @@ describe('RecipePicker', () => {
expect(badge.getAttribute('data-type')).toBe('good');
});
it('shows yellow badge when hasConflict is true', () => {
it('shows red delta badge when hasConflict is true', () => {
render(RecipePicker, { props: baseProps });
// Hähnchen-Curry: hasConflict = true → yellow badge
// Hähnchen-Curry: hasConflict = true, scoreDelta = -1.5 → red badge with delta
const badge = screen.getByTestId('badge-s2');
expect(badge.getAttribute('data-type')).toBe('warning');
expect(badge.getAttribute('data-type')).toBe('bad');
expect(badge.textContent).toContain('-1.5');
});
it('shows Alle Rezepte section', () => {