fix(recipes): address B2 review — tags, sort, edit link, types, a11y, tests
- RecipeHero: render tag pills, min-h-[200px/240px], fix back link styling, remove font-[400] - IngredientList: sort by sortOrder ascending - StepList: aria-hidden on step circles - types.ts: add Tag, Ingredient, Step, RecipeDetail shared types - +page.svelte: add Edit link → /recipes/[id]/edit (desktop topbar) - Tests: tag pills, sortOrder sort, edit link, image variant, 403-as-404 documented Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -63,4 +63,25 @@ describe('RecipeHero', () => {
|
||||
render(RecipeHero, { props: { recipe: baseRecipe } });
|
||||
expect(screen.queryByRole('img')).not.toBeInTheDocument();
|
||||
});
|
||||
|
||||
it('renders tag pills', () => {
|
||||
render(RecipeHero, {
|
||||
props: {
|
||||
recipe: {
|
||||
...baseRecipe,
|
||||
tags: [
|
||||
{ id: 't1', name: 'Pasta' },
|
||||
{ id: 't2', name: 'Italienisch' }
|
||||
]
|
||||
}
|
||||
}
|
||||
});
|
||||
expect(screen.getByText('Pasta')).toBeInTheDocument();
|
||||
expect(screen.getByText('Italienisch')).toBeInTheDocument();
|
||||
});
|
||||
|
||||
it('renders no tag pills when tags array is empty', () => {
|
||||
render(RecipeHero, { props: { recipe: { ...baseRecipe, tags: [] } } });
|
||||
expect(screen.queryByText('Pasta')).not.toBeInTheDocument();
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user