]> Untitled Git - lemmy.git/blob - crates/apub/src/protocol/activities/community/mod.rs
d43e111e0b989b814c609e7990578ca806f33f33
[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   use crate::protocol::{
11     activities::community::{
12       announce::AnnounceActivity,
13       collection_add::CollectionAdd,
14       collection_remove::CollectionRemove,
15       lock_page::{LockPage, UndoLockPage},
16       report::Report,
17       update::UpdateCommunity,
18     },
19     tests::test_parse_lemmy_item,
20   };
21
22   #[test]
23   fn test_parse_lemmy_community_activities() {
24     test_parse_lemmy_item::<AnnounceActivity>(
25       "assets/lemmy/activities/community/announce_create_page.json",
26     )
27     .unwrap();
28
29     test_parse_lemmy_item::<CollectionAdd>("assets/lemmy/activities/community/add_mod.json")
30       .unwrap();
31     test_parse_lemmy_item::<CollectionRemove>("assets/lemmy/activities/community/remove_mod.json")
32       .unwrap();
33
34     test_parse_lemmy_item::<CollectionAdd>(
35       "assets/lemmy/activities/community/add_featured_post.json",
36     )
37     .unwrap();
38     test_parse_lemmy_item::<CollectionRemove>(
39       "assets/lemmy/activities/community/remove_featured_post.json",
40     )
41     .unwrap();
42
43     test_parse_lemmy_item::<LockPage>("assets/lemmy/activities/community/lock_page.json").unwrap();
44     test_parse_lemmy_item::<UndoLockPage>("assets/lemmy/activities/community/undo_lock_page.json")
45       .unwrap();
46
47     test_parse_lemmy_item::<UpdateCommunity>(
48       "assets/lemmy/activities/community/update_community.json",
49     )
50     .unwrap();
51
52     test_parse_lemmy_item::<Report>("assets/lemmy/activities/community/report_page.json").unwrap();
53   }
54 }