events: Use a custom event for the custom event tests.
This commit is contained in:
parent
e02d76f4b0
commit
8f710a371b
@ -192,28 +192,20 @@ fn deserialize_custom_state_sync_event() {
|
|||||||
fn deserialize_custom_message_sync_event() {
|
fn deserialize_custom_message_sync_event() {
|
||||||
let json_data = json!({
|
let json_data = json!({
|
||||||
"content": {
|
"content": {
|
||||||
"m.relates_to": {
|
"body": "👍"
|
||||||
"event_id": "$MDitXXXXXX",
|
|
||||||
"key": "👍",
|
|
||||||
"rel_type": "m.annotation"
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
"event_id": "$h29iv0s8:example.com",
|
"event_id": "$h29iv0s8:example.com",
|
||||||
"origin_server_ts": 10,
|
"origin_server_ts": 10,
|
||||||
"room_id": "!room:room.com",
|
"room_id": "!room:room.com",
|
||||||
"sender": "@carl:example.com",
|
"sender": "@carl:example.com",
|
||||||
"type": "m.reaction",
|
"type": "m.ruma_custom",
|
||||||
"unsigned": {
|
"unsigned": {
|
||||||
"age": 85
|
"age": 85
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
let expected_content = json!({
|
let expected_content = json!({
|
||||||
"m.relates_to": {
|
"body": "👍",
|
||||||
"event_id": "$MDitXXXXXX",
|
|
||||||
"key": "👍",
|
|
||||||
"rel_type": "m.annotation"
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
assert_matches!(
|
assert_matches!(
|
||||||
@ -227,7 +219,7 @@ fn deserialize_custom_message_sync_event() {
|
|||||||
origin_server_ts,
|
origin_server_ts,
|
||||||
sender,
|
sender,
|
||||||
unsigned,
|
unsigned,
|
||||||
})) if json == expected_content && event_type == "m.reaction"
|
})) if json == expected_content && event_type == "m.ruma_custom"
|
||||||
&& event_id == event_id!("$h29iv0s8:example.com")
|
&& event_id == event_id!("$h29iv0s8:example.com")
|
||||||
&& origin_server_ts == UNIX_EPOCH + Duration::from_millis(10)
|
&& origin_server_ts == UNIX_EPOCH + Duration::from_millis(10)
|
||||||
&& sender == user_id!("@carl:example.com")
|
&& sender == user_id!("@carl:example.com")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user