]> Untitled Git - lemmy.git/blob - crates/apub/src/protocol/activities/community/mod.rs
4f1f2be91a6eba23641c307d5255cf2b81997337
[lemmy.git] / crates / apub / src / protocol / activities / community / mod.rs
1 pub mod add_mod;
2 pub mod announce;
3 pub mod block_user;
4 pub mod remove_mod;
5 pub mod report;
6 pub mod undo_block_user;
7 pub mod update;
8
9 #[cfg(test)]
10 mod tests {
11   use crate::protocol::{
12     activities::community::{
13       add_mod::AddMod,
14       announce::AnnounceActivity,
15       block_user::BlockUserFromCommunity,
16       remove_mod::RemoveMod,
17       report::Report,
18       undo_block_user::UndoBlockUserFromCommunity,
19       update::UpdateCommunity,
20     },
21     tests::test_parse_lemmy_item,
22   };
23
24   #[actix_rt::test]
25   async fn test_parse_lemmy_community() {
26     test_parse_lemmy_item::<AnnounceActivity>(
27       "assets/lemmy/activities/community/announce_create_page.json",
28     );
29
30     test_parse_lemmy_item::<AddMod>("assets/lemmy/activities/community/add_mod.json");
31     test_parse_lemmy_item::<RemoveMod>("assets/lemmy/activities/community/remove_mod.json");
32
33     test_parse_lemmy_item::<BlockUserFromCommunity>(
34       "assets/lemmy/activities/community/block_user.json",
35     );
36     test_parse_lemmy_item::<UndoBlockUserFromCommunity>(
37       "assets/lemmy/activities/community/undo_block_user.json",
38     );
39
40     test_parse_lemmy_item::<UpdateCommunity>(
41       "assets/lemmy/activities/community/update_community.json",
42     );
43
44     test_parse_lemmy_item::<Report>("assets/lemmy/activities/community/report_page.json");
45   }
46 }