feat(planner): show yellow neutral badge for scoreDelta = 0 in RecipePicker
Neutral suggestions (no variety impact) now show "= 0.0 Punkte" in yellow instead of no badge, making the three states explicit: green (improves), yellow (neutral), red (worsens). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -99,12 +99,14 @@ describe('RecipePicker', () => {
|
||||
expect(screen.getByText(/Keine Treffer/i)).toBeTruthy();
|
||||
});
|
||||
|
||||
it('shows no badge when scoreDelta is zero (neutral, no improvement)', () => {
|
||||
it('shows yellow neutral badge when scoreDelta is zero', () => {
|
||||
const neutralSuggestions = [
|
||||
{ recipe: { id: 'sn', name: 'Neutrales Rezept', effort: 'easy', cookTimeMin: 20 }, scoreDelta: 0.0, hasConflict: false }
|
||||
];
|
||||
render(RecipePicker, { props: { ...baseProps, suggestions: neutralSuggestions } });
|
||||
expect(screen.queryByTestId('badge-sn')).toBeNull();
|
||||
const badge = screen.getByTestId('badge-sn');
|
||||
expect(badge.getAttribute('data-type')).toBe('neutral');
|
||||
expect(badge.textContent).toContain('0.0');
|
||||
});
|
||||
|
||||
it('shows loading skeleton instead of Empfohlen section when isLoading is true', () => {
|
||||
|
||||
Reference in New Issue
Block a user