diff --git a/frontend/e2e/persons.spec.ts b/frontend/e2e/persons.spec.ts index dcc83275..78e43c27 100644 --- a/frontend/e2e/persons.spec.ts +++ b/frontend/e2e/persons.spec.ts @@ -94,11 +94,13 @@ test.describe('Person detail — sort toggle', () => { test.describe('Person detail — conversations link', () => { test('has a conversations link that pre-fills the person', async ({ page }) => { await page.goto('/persons'); - const firstLink = page.locator('a[href^="/persons/"]').first(); + // Exclude /persons/new to avoid matching the "New person" button + const firstLink = page.locator('a[href^="/persons/"]:not([href="/persons/new"])').first(); const href = await firstLink.getAttribute('href'); const personId = href!.split('/persons/')[1]; await firstLink.click(); - const convLink = page.getByRole('link', { name: /Konversationen/i }); + // Use the specific person-detail link text, not the nav "Konversationen" link + const convLink = page.getByRole('link', { name: /Konversationen anzeigen/i }); await expect(convLink).toBeVisible(); await expect(convLink).toHaveAttribute('href', `/conversations?senderId=${personId}`); });