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