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:
@@ -174,6 +174,18 @@ describe('ChronikRow', () => {
|
|||||||
expect(link).not.toBeNull();
|
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 ---
|
// --- robustness: title rendering for edge cases ---
|
||||||
it('still renders the row link when documentTitle is an empty string', async () => {
|
it('still renders the row link when documentTitle is an empty string', async () => {
|
||||||
// Felix: verbText.indexOf(docTitle) returned 0 for empty titles — the span
|
// Felix: verbText.indexOf(docTitle) returned 0 for empty titles — the span
|
||||||
|
|||||||
Reference in New Issue
Block a user