events: Update IgnoredUserListEvent test

This commit is contained in:
Kévin Commaille 2021-05-11 10:22:14 +02:00 committed by Jonas Platte
parent 7fd350d6c6
commit cb489729b8

View File

@ -33,8 +33,8 @@ mod tests {
use ruma_serde::Raw; use ruma_serde::Raw;
use serde_json::{from_value as from_json_value, json, to_value as to_json_value}; use serde_json::{from_value as from_json_value, json, to_value as to_json_value};
use super::IgnoredUserListEventContent; use super::{IgnoredUserListEvent, IgnoredUserListEventContent};
use crate::{AnyGlobalAccountDataEventContent, GlobalAccountDataEvent}; use crate::{AnyGlobalAccountDataEvent, GlobalAccountDataEvent};
#[test] #[test]
fn serialization() { fn serialization() {
@ -68,15 +68,17 @@ mod tests {
}); });
assert_matches!( assert_matches!(
from_json_value::<Raw<GlobalAccountDataEvent<AnyGlobalAccountDataEventContent>>>(json) from_json_value::<Raw<AnyGlobalAccountDataEvent>>(json)
.unwrap() .unwrap()
.deserialize() .deserialize()
.unwrap(), .unwrap(),
GlobalAccountDataEvent { AnyGlobalAccountDataEvent::IgnoredUserList(
content: AnyGlobalAccountDataEventContent::IgnoredUserList(IgnoredUserListEventContent { IgnoredUserListEvent {
ignored_users, content: IgnoredUserListEventContent {
}), ignored_users
} if ignored_users == vec![user_id!("@carl:example.com")] },
})
if ignored_users == vec![user_id!("@carl:example.com")]
); );
} }
} }