diff --git a/frontend/src/lib/shared/discussion/mention.spec.ts b/frontend/src/lib/shared/discussion/mention.spec.ts index f063ab3b..a049d669 100644 --- a/frontend/src/lib/shared/discussion/mention.spec.ts +++ b/frontend/src/lib/shared/discussion/mention.spec.ts @@ -307,9 +307,21 @@ describe('renderTranscriptionBody', () => { expect(result).not.toMatch(/>O"Brien<\/a>/); }); - it('renders nothing when mentionedPersons is undefined-empty and no @ triggers', () => { - const result = renderTranscriptionBody('Plain old transcription text.', []); - expect(result).toBe('Plain old transcription text.'); + it('renders a deleted-person @mention as plain text with no dead link (graceful degradation)', () => { + // AC-6 (#684): when a mentioned person is deleted, V71's ON DELETE CASCADE removes the + // sidecar row, so the displayName reaches the renderer with an empty mentionedPersons + // array. The reader must still see the name as plain text — never a dead , a + // person-mention class, a data-person-id, or an href. This locks the degradation + // contract so a future renderer refactor cannot silently reintroduce a dead link. + const result = renderTranscriptionBody('Brief an @Auguste Raddatz vom Mai', []); + // (a) the reader still sees the readable name and the surrounding sentence verbatim + expect(result).toContain('Auguste Raddatz'); + expect(result).toBe('Brief an @Auguste Raddatz vom Mai'); + // (b) none of the anchor artifacts leak through + expect(result).not.toContain(' {