1 use serde::{Deserialize, Serialize};
2 use strum_macros::Display;
6 pub mod create_or_update;
11 #[derive(Clone, Debug, Display, Deserialize, Serialize, PartialEq)]
12 pub enum CreateOrUpdateType {
19 use crate::protocol::{
21 create_or_update::{comment::CreateOrUpdateComment, post::CreateOrUpdatePost},
22 deletion::delete::Delete,
23 following::{follow::FollowCommunity, undo_follow::UndoFollowCommunity},
29 fn test_parse_smithereen_activities() {
30 test_json::<CreateOrUpdateComment>("assets/smithereen/activities/create_note.json").unwrap();
34 fn test_parse_pleroma_activities() {
35 test_json::<CreateOrUpdateComment>("assets/pleroma/activities/create_note.json").unwrap();
36 test_json::<Delete>("assets/pleroma/activities/delete.json").unwrap();
37 test_json::<FollowCommunity>("assets/pleroma/activities/follow.json").unwrap();
41 fn test_parse_mastodon_activities() {
42 test_json::<CreateOrUpdateComment>("assets/mastodon/activities/create_note.json").unwrap();
43 test_json::<Delete>("assets/mastodon/activities/delete.json").unwrap();
44 test_json::<FollowCommunity>("assets/mastodon/activities/follow.json").unwrap();
45 test_json::<UndoFollowCommunity>("assets/mastodon/activities/undo_follow.json").unwrap();
49 fn test_parse_lotide_activities() {
50 test_json::<CreateOrUpdatePost>("assets/lotide/activities/create_page.json").unwrap();
51 test_json::<CreateOrUpdateComment>("assets/lotide/activities/create_note_reply.json").unwrap();
55 fn test_parse_friendica_activities() {
56 test_json::<CreateOrUpdateComment>("assets/friendica/activities/create_note.json").unwrap();