feat(planner): hide RecipePicker inner header in swap context
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -88,7 +88,8 @@
|
|||||||
{/snippet}
|
{/snippet}
|
||||||
|
|
||||||
<div style="background: var(--color-page); font-family: var(--font-sans);">
|
<div style="background: var(--color-page); font-family: var(--font-sans);">
|
||||||
<!-- Header -->
|
<!-- Header (hidden in swap context — the panel/sheet title already provides context) -->
|
||||||
|
{#if !replacingRecipe}
|
||||||
<div style="padding: 10px 12px 6px; border-bottom: 1px solid var(--color-border);">
|
<div style="padding: 10px 12px 6px; border-bottom: 1px solid var(--color-border);">
|
||||||
<p style="font-family: var(--font-display); font-size: 14px; font-weight: 500; color: var(--color-text); margin: 0;">
|
<p style="font-family: var(--font-display); font-size: 14px; font-weight: 500; color: var(--color-text); margin: 0;">
|
||||||
Rezept wählen
|
Rezept wählen
|
||||||
@@ -97,6 +98,7 @@
|
|||||||
{dateLabel}
|
{dateLabel}
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
{/if}
|
||||||
|
|
||||||
<!-- Wird ersetzt banner (swap context) -->
|
<!-- Wird ersetzt banner (swap context) -->
|
||||||
{#if replacingRecipe}
|
{#if replacingRecipe}
|
||||||
|
|||||||
@@ -186,6 +186,16 @@ describe('RecipePicker', () => {
|
|||||||
expect(screen.queryByText(/Wird ersetzt/i)).toBeNull();
|
expect(screen.queryByText(/Wird ersetzt/i)).toBeNull();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('hides Rezept wählen header when replacingRecipe is set', () => {
|
||||||
|
render(RecipePicker, { props: { ...baseProps, replacingRecipe: { name: 'Pasta' } } });
|
||||||
|
expect(screen.queryByText(/Rezept wählen/i)).toBeNull();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('shows Rezept wählen header when replacingRecipe is not set', () => {
|
||||||
|
render(RecipePicker, { props: baseProps });
|
||||||
|
expect(screen.getByText(/Rezept wählen/i)).toBeTruthy();
|
||||||
|
});
|
||||||
|
|
||||||
it('excludes recipe from Alle Rezepte when excludeRecipeId is set', () => {
|
it('excludes recipe from Alle Rezepte when excludeRecipeId is set', () => {
|
||||||
render(RecipePicker, { props: { ...baseProps, excludeRecipeId: 'r2' } });
|
render(RecipePicker, { props: { ...baseProps, excludeRecipeId: 'r2' } });
|
||||||
expect(screen.queryByText('Spaghetti Carbonara')).toBeNull();
|
expect(screen.queryByText('Spaghetti Carbonara')).toBeNull();
|
||||||
|
|||||||
Reference in New Issue
Block a user