2022-12-01 20:52:49 +00:00
|
|
|
pub mod chat_message;
|
|
|
|
pub mod note;
|
|
|
|
pub mod page;
|
2021-11-01 13:05:20 +00:00
|
|
|
|
|
|
|
#[cfg(test)]
|
|
|
|
mod tests {
|
2023-07-17 15:04:14 +00:00
|
|
|
#![allow(clippy::unwrap_used)]
|
|
|
|
#![allow(clippy::indexing_slicing)]
|
|
|
|
|
2022-02-17 22:04:01 +00:00
|
|
|
use crate::protocol::{
|
|
|
|
activities::create_or_update::{
|
2022-12-01 20:52:49 +00:00
|
|
|
chat_message::CreateOrUpdateChatMessage,
|
|
|
|
note::CreateOrUpdateNote,
|
|
|
|
page::CreateOrUpdatePage,
|
2021-11-01 13:05:20 +00:00
|
|
|
},
|
2022-02-17 22:04:01 +00:00
|
|
|
tests::test_parse_lemmy_item,
|
2021-11-01 13:05:20 +00:00
|
|
|
};
|
|
|
|
|
2022-02-17 22:04:01 +00:00
|
|
|
#[test]
|
|
|
|
fn test_parse_lemmy_create_or_update() {
|
2022-12-01 20:52:49 +00:00
|
|
|
test_parse_lemmy_item::<CreateOrUpdatePage>(
|
2021-11-01 13:05:20 +00:00
|
|
|
"assets/lemmy/activities/create_or_update/create_page.json",
|
2022-01-20 14:13:29 +00:00
|
|
|
)
|
|
|
|
.unwrap();
|
2022-12-01 20:52:49 +00:00
|
|
|
test_parse_lemmy_item::<CreateOrUpdatePage>(
|
2021-11-01 13:05:20 +00:00
|
|
|
"assets/lemmy/activities/create_or_update/update_page.json",
|
2022-01-20 14:13:29 +00:00
|
|
|
)
|
|
|
|
.unwrap();
|
2022-12-01 20:52:49 +00:00
|
|
|
test_parse_lemmy_item::<CreateOrUpdateNote>(
|
2021-11-01 13:05:20 +00:00
|
|
|
"assets/lemmy/activities/create_or_update/create_note.json",
|
2022-01-20 14:13:29 +00:00
|
|
|
)
|
|
|
|
.unwrap();
|
2022-12-01 20:52:49 +00:00
|
|
|
test_parse_lemmy_item::<CreateOrUpdateChatMessage>(
|
2022-02-14 15:14:24 +00:00
|
|
|
"assets/lemmy/activities/create_or_update/create_private_message.json",
|
|
|
|
)
|
|
|
|
.unwrap();
|
2021-11-01 13:05:20 +00:00
|
|
|
}
|
|
|
|
}
|