events: Add a test for edit deserialization without unstable-pre-spec
This commit is contained in:
parent
0f64a6ea39
commit
9a4206b1b2
@ -646,6 +646,28 @@ mod tests {
|
|||||||
assert_eq!(to_json_value(&message_event_content).unwrap(), json_data);
|
assert_eq!(to_json_value(&message_event_content).unwrap(), json_data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
#[cfg(not(feature = "unstable-pre-spec"))]
|
||||||
|
fn edit_deserialization() {
|
||||||
|
let json_data = json!({
|
||||||
|
"body": "test",
|
||||||
|
"msgtype": "m.text",
|
||||||
|
"m.relates_to": {
|
||||||
|
"rel_type": "m.replace",
|
||||||
|
"event_id": event_id!("$1598361704261elfgc:localhost"),
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
assert_matches!(
|
||||||
|
from_json_value::<MessageEventContent>(json_data).unwrap(),
|
||||||
|
MessageEventContent::Text(TextMessageEventContent {
|
||||||
|
body,
|
||||||
|
formatted: None,
|
||||||
|
relates_to: Some(Relation::Custom(_)),
|
||||||
|
}) if body == "test"
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn content_deserialization() {
|
fn content_deserialization() {
|
||||||
let json_data = json!({
|
let json_data = json!({
|
||||||
|
Loading…
x
Reference in New Issue
Block a user