diff --git a/frontend/src/lib/planner/SwapSuggestionList.svelte b/frontend/src/lib/planner/SwapSuggestionList.svelte index 68273f8..d49210d 100644 --- a/frontend/src/lib/planner/SwapSuggestionList.svelte +++ b/frontend/src/lib/planner/SwapSuggestionList.svelte @@ -39,7 +39,7 @@
- Replacing + Wird ersetzt
- Swap to (easiest first) + Ersetzen durch (einfachste zuerst) @@ -98,7 +98,7 @@ onclick={() => onpick(recipe.id, recipe.name)} style="background: none; border: none; cursor: pointer; font-size: 11px; font-weight: 500; color: var(--green); font-family: var(--font-sans); flex-shrink: 0;" > - Pick + Wählen {/each} @@ -111,6 +111,6 @@ onclick={oncancel} style="width: 100%; background: none; border: none; cursor: pointer; color: var(--color-text-muted); font-size: 13px; text-align: center; padding: 8px 0; font-family: var(--font-sans);" > - Cancel + Abbrechen {/if} diff --git a/frontend/src/lib/planner/SwapSuggestionList.test.ts b/frontend/src/lib/planner/SwapSuggestionList.test.ts index 9fc9f32..1313db4 100644 --- a/frontend/src/lib/planner/SwapSuggestionList.test.ts +++ b/frontend/src/lib/planner/SwapSuggestionList.test.ts @@ -20,7 +20,7 @@ const baseProps = { describe('SwapSuggestionList', () => { it('renders the Replacing banner', () => { render(SwapSuggestionList, { props: baseProps }); - expect(screen.getByText(/Replacing/i)).toBeTruthy(); + expect(screen.getByText(/Wird ersetzt/i)).toBeTruthy(); }); it('renders old meal name with strikethrough', () => { @@ -32,7 +32,7 @@ describe('SwapSuggestionList', () => { it('renders the easiest-first eyebrow label', () => { render(SwapSuggestionList, { props: baseProps }); - expect(screen.getByText(/easiest first/i)).toBeTruthy(); + expect(screen.getByText(/einfachste zuerst/i)).toBeTruthy(); }); it('renders all recipe names', () => { @@ -42,11 +42,11 @@ describe('SwapSuggestionList', () => { expect(screen.getByText('Mushroom risotto')).toBeTruthy(); }); - it('clicking Pick calls onpick with recipeId and name', async () => { + it('clicking Wählen calls onpick with recipeId and name', async () => { const onpick = vi.fn(); const user = userEvent.setup(); render(SwapSuggestionList, { props: { ...baseProps, onpick } }); - const buttons = screen.getAllByRole('button', { name: /Pick/i }); + const buttons = screen.getAllByRole('button', { name: /Wählen/i }); await user.click(buttons[0]); expect(onpick).toHaveBeenCalledWith('r1', 'Quick carbonara'); }); @@ -68,21 +68,21 @@ describe('SwapSuggestionList', () => { expect(screen.getByTestId('swap-empty-state')).toBeTruthy(); }); - it('renders optional Cancel button when oncancel provided', () => { + it('renders optional Abbrechen button when oncancel provided', () => { render(SwapSuggestionList, { props: { ...baseProps, oncancel: vi.fn() } }); - expect(screen.getByRole('button', { name: /Cancel/i })).toBeTruthy(); + expect(screen.getByRole('button', { name: /Abbrechen/i })).toBeTruthy(); }); - it('does not render Cancel button when oncancel not provided', () => { + it('does not render Abbrechen button when oncancel not provided', () => { render(SwapSuggestionList, { props: baseProps }); - expect(screen.queryByRole('button', { name: /Cancel/i })).toBeNull(); + expect(screen.queryByRole('button', { name: /Abbrechen/i })).toBeNull(); }); - it('clicking Cancel calls oncancel', async () => { + it('clicking Abbrechen calls oncancel', async () => { const oncancel = vi.fn(); const user = userEvent.setup(); render(SwapSuggestionList, { props: { ...baseProps, oncancel } }); - await user.click(screen.getByRole('button', { name: /Cancel/i })); + await user.click(screen.getByRole('button', { name: /Abbrechen/i })); expect(oncancel).toHaveBeenCalledOnce(); }); });