feat(persons): add sort toggle to person document list (issue #24) #26

Merged
marcel merged 3 commits from feat/person-sort-documents into main 2026-03-19 21:51:48 +01:00
Showing only changes of commit c01a07bd82 - Show all commits

View File

@@ -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}`);
});