From a15e4e139be0631fa701ac4827849ac5a45b0ff8 Mon Sep 17 00:00:00 2001 From: Marcel Date: Tue, 21 Apr 2026 18:34:41 +0200 Subject: [PATCH] test(chronik-row): add coverage for commentId-only URL when annotationId absent Co-Authored-By: Claude Sonnet 4.6 --- .../lib/components/chronik/ChronikRow.svelte.spec.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/frontend/src/lib/components/chronik/ChronikRow.svelte.spec.ts b/frontend/src/lib/components/chronik/ChronikRow.svelte.spec.ts index 76ac3810..c95e761b 100644 --- a/frontend/src/lib/components/chronik/ChronikRow.svelte.spec.ts +++ b/frontend/src/lib/components/chronik/ChronikRow.svelte.spec.ts @@ -174,6 +174,18 @@ describe('ChronikRow', () => { expect(link).not.toBeNull(); }); + it('links to commentId-only URL when commentId is set but annotationId is absent', async () => { + const item: ActivityFeedItemDTO = { + ...baseItem, + kind: 'COMMENT_ADDED', + commentId: 'comment-7' + // annotationId absent — comment on a non-annotation block + }; + render(ChronikRow, { item }); + const link = document.querySelector('a[href="/documents/doc-1?commentId=comment-7"]'); + expect(link).not.toBeNull(); + }); + // --- robustness: title rendering for edge cases --- it('still renders the row link when documentTitle is an empty string', async () => { // Felix: verbText.indexOf(docTitle) returned 0 for empty titles — the span