test(chronik-row): add coverage for commentId-only URL when annotationId absent

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Marcel
2026-04-21 18:34:41 +02:00
parent e175e050f9
commit a15e4e139b

View File

@@ -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