]> Untitled Git - lemmy.git/blob - crates/apub/src/protocol/activities/community/mod.rs
Cache & Optimize Woodpecker CI (#3450)
[lemmy.git] / crates / apub / src / protocol / activities / community / mod.rs
1 pub mod announce;
2 pub mod collection_add;
3 pub mod collection_remove;
4 pub mod lock_page;
5 pub mod report;
6 pub mod update;
7
8 #[cfg(test)]
9 mod tests {
10   #![allow(clippy::unwrap_used)]
11   #![allow(clippy::indexing_slicing)]
12
13   use crate::protocol::{
14     activities::community::{
15       announce::AnnounceActivity,
16       collection_add::CollectionAdd,
17       collection_remove::CollectionRemove,
18       lock_page::{LockPage, UndoLockPage},
19       report::Report,
20       update::UpdateCommunity,
21     },
22     tests::test_parse_lemmy_item,
23   };
24
25   #[test]
26   fn test_parse_lemmy_community_activities() {
27     test_parse_lemmy_item::<AnnounceActivity>(
28       "assets/lemmy/activities/community/announce_create_page.json",
29     )
30     .unwrap();
31
32     test_parse_lemmy_item::<CollectionAdd>("assets/lemmy/activities/community/add_mod.json")
33       .unwrap();
34     test_parse_lemmy_item::<CollectionRemove>("assets/lemmy/activities/community/remove_mod.json")
35       .unwrap();
36
37     test_parse_lemmy_item::<CollectionAdd>(
38       "assets/lemmy/activities/community/add_featured_post.json",
39     )
40     .unwrap();
41     test_parse_lemmy_item::<CollectionRemove>(
42       "assets/lemmy/activities/community/remove_featured_post.json",
43     )
44     .unwrap();
45
46     test_parse_lemmy_item::<LockPage>("assets/lemmy/activities/community/lock_page.json").unwrap();
47     test_parse_lemmy_item::<UndoLockPage>("assets/lemmy/activities/community/undo_lock_page.json")
48       .unwrap();
49
50     test_parse_lemmy_item::<UpdateCommunity>(
51       "assets/lemmy/activities/community/update_community.json",
52     )
53     .unwrap();
54
55     test_parse_lemmy_item::<Report>("assets/lemmy/activities/community/report_page.json").unwrap();
56   }
57 }