chore: add 2 more assert for publish view comments

This commit is contained in:
Zack Fu Zi Xiang 2024-11-11 15:14:22 +08:00
parent b89490777c
commit 5d040a6e7f
No known key found for this signature in database
1 changed files with 16 additions and 0 deletions

View File

@ -565,6 +565,14 @@ async fn test_publish_comments() {
// Test if it's possible to reply to another user's comment
let second_user_comment_content = "comment from second authenticated user";
let (second_user_client, second_user) = generate_unique_registered_user_client().await;
{
let published_view_comments: Vec<GlobalComment> = guest_client
.get_published_view_comments(&view_id)
.await
.unwrap()
.comments;
assert_eq!(published_view_comments.len(), 2);
}
// User 2 reply to user 1
second_user_client
.create_comment_on_published_view(
@ -574,6 +582,14 @@ async fn test_publish_comments() {
)
.await
.unwrap();
{
let published_view_comments: Vec<GlobalComment> = guest_client
.get_published_view_comments(&view_id)
.await
.unwrap()
.comments;
assert_eq!(published_view_comments.len(), 3);
}
let published_view_comments: Vec<GlobalComment> = guest_client
.get_published_view_comments(&view_id)
.await