feat(person-mention): PR-B2 — read-mode rendering + hover card (issue #362) #371

Merged
marcel merged 18 commits from feat/person-mentions-issue-362-frontend-b2 into main 2026-04-29 13:37:06 +02:00
Showing only changes of commit bc58d77f2c - Show all commits

View File

@@ -44,8 +44,14 @@ test.describe('Person mention — read mode', () => {
personId = person.id;
// 2. Document with a PDF so the transcription panel is mountable.
// Sara #3: timestamp the title so a previous run that crashed in beforeAll
// (and therefore skipped afterAll cleanup) cannot collide with this one.
const uniqueSuffix = Date.now();
const docRes = await request.post('/api/documents', {
multipart: { title: 'E2E Person Mention Read', documentDate: '1945-05-08' }
multipart: {
title: `E2E Person Mention Read ${uniqueSuffix}`,
documentDate: '1945-05-08'
}
});
if (!docRes.ok()) throw new Error(`Create document failed: ${docRes.status()}`);
const doc = await docRes.json();
@@ -54,7 +60,7 @@ test.describe('Person mention — read mode', () => {
await request.put(`/api/documents/${docId}`, {
multipart: {
title: doc.title,
title: doc.title as string,
documentDate: '1945-05-08',
file: {
name: 'minimal.pdf',
@@ -143,10 +149,13 @@ test.describe('Person mention — read mode', () => {
const link = touchPage.locator(`a.person-mention[data-person-id="${personId}"]`).first();
await expect(link).toBeVisible({ timeout: 5000 });
await link.tap();
// The card never mounted — the tap navigated directly per spec
await expect(touchPage).toHaveURL(new RegExp(`/persons/${personId}`));
// Sara #2: assert no card *before* the tap so the test actually proves
// the touch device suppression worked, not just that we navigated away.
await expect(touchPage.getByTestId('person-hover-card')).toHaveCount(0);
await link.tap();
// The card never mounted — the tap navigated directly per spec.
await expect(touchPage).toHaveURL(new RegExp(`/persons/${personId}`));
} finally {
await context.close();
}