diff --git a/frontend/src/routes/conversations/+page.svelte b/frontend/src/routes/conversations/+page.svelte index 9cb882f0..8467a3b2 100644 --- a/frontend/src/routes/conversations/+page.svelte +++ b/frontend/src/routes/conversations/+page.svelte @@ -91,32 +91,35 @@ const enrichedDocuments = $derived( /> - - {#if senderId && receiverId} -
- -
- {/if} + + + {m.conv_swap_btn()} + +
{ await expect.element(page.getByText(/Wählen Sie zwei Personen aus/i)).toBeInTheDocument(); }); - it('does not show the swap button when no persons are selected', async () => { + it('hides the swap button when no persons are selected', async () => { render(Page, { data: baseData }); - await expect.element(page.getByTestId('conv-swap-btn')).not.toBeInTheDocument(); + // Button is always in the DOM (holds grid column width on desktop) but made invisible + await expect.element(page.getByTestId('conv-swap-btn')).toHaveClass('invisible'); }); it('does not show the new document link when no persons are selected', async () => { @@ -76,7 +77,7 @@ describe('Conversations page – no results', () => { describe('Conversations page – swap button', () => { it('shows the swap button when both persons are selected', async () => { render(Page, { data: withPersons }); - await expect.element(page.getByTestId('conv-swap-btn')).toBeInTheDocument(); + await expect.element(page.getByTestId('conv-swap-btn')).not.toHaveClass('invisible'); }); it('calls goto with swapped sender and receiver when clicked', async () => {