diff --git a/src/models/posts/queries.rs b/src/models/posts/queries.rs index 6c39c7b..55617d1 100644 --- a/src/models/posts/queries.rs +++ b/src/models/posts/queries.rs @@ -1205,6 +1205,25 @@ mod tests { assert_eq!(post.updated_at.is_some(), true); } + #[tokio::test] + #[serial] + async fn test_delete_post() { + let db_client = &mut create_test_database().await; + let user_data = UserCreateData { + username: "test".to_string(), + ..Default::default() + }; + let user = create_user(db_client, user_data).await.unwrap(); + let post_data = PostCreateData { + content: "test post".to_string(), + ..Default::default() + }; + let post = create_post(db_client, &user.id, post_data).await.unwrap(); + let deletion_queue = delete_post(db_client, &post.id).await.unwrap(); + assert_eq!(deletion_queue.files.len(), 0); + assert_eq!(deletion_queue.ipfs_objects.len(), 0); + } + #[tokio::test] #[serial] async fn test_home_timeline() {