Skip to content

Commit a581861

Browse files
committed
chore: update behavior test
1 parent 2fff3f0 commit a581861

1 file changed

Lines changed: 11 additions & 4 deletions

File tree

tests/behavior/tests/comments/comment-on-tracked-change.spec.ts

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,18 @@ test('comment thread on tracked change shows both the change and replies', async
3939
await expect(dialog.locator('.tracked-change-text.is-inserted', { hasText: 'new text' })).toBeVisible();
4040
await expect(dialog.locator('.tracked-change-text.is-deleted').first()).toBeVisible();
4141

42-
// The threaded comment replies should be visible below the tracked change
42+
// Threads with >=2 replies are collapsed by default: only the latest reply is visible
43+
const collapsedPill = dialog.locator('.collapsed-replies');
44+
await expect(collapsedPill).toBeVisible({ timeout: 5_000 });
45+
await expect(collapsedPill).toContainText('1 more reply');
46+
47+
// In collapsed state, only one reply body is visible
4348
const commentBodies = dialog.locator('.comment-body .comment');
44-
await expect(commentBodies).toHaveCount(2);
45-
await expect(commentBodies.nth(0)).toContainText('reply to tracked change');
46-
await expect(commentBodies.nth(1)).toContainText('reply to reply');
49+
await expect(commentBodies).toHaveCount(1);
50+
await expect(commentBodies.first()).toContainText('reply to reply');
51+
52+
// Hidden reply summary should remain visible in collapsed mode
53+
await expect(collapsedPill).toBeVisible();
4754

4855
await superdoc.snapshot('comment thread on tracked change');
4956
});

0 commit comments

Comments
 (0)