mirror of
https://github.com/teloxide/teloxide.git
synced 2024-12-23 15:01:45 +01:00
Add regression test for issue 523
This commit is contained in:
parent
fb523f153e
commit
c0795f0dc9
1 changed files with 21 additions and 0 deletions
|
@ -492,4 +492,25 @@ mod test {
|
|||
_ => panic!("Expected error"),
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn issue_523() {
|
||||
let json = r#"{
|
||||
"update_id":0,
|
||||
"my_chat_member": {
|
||||
"chat":{"id":0,"first_name":"FN","last_name":"LN","username":"UN","type":"private"},
|
||||
"from":{"id":0,"is_bot":false,"first_name":"FN","last_name":"LN","username":"UN"},
|
||||
"date":1644677726,
|
||||
"old_chat_member":{"user":{"id":1,"is_bot":true,"first_name":"bot","username":"unBot"},"status":"member"},
|
||||
"new_chat_member":{"user":{"id":1,"is_bot":true,"first_name":"bot","username":"unBot"},"status":"kicked","until_date":0}
|
||||
}
|
||||
}"#;
|
||||
|
||||
let Update { kind, .. } = serde_json::from_str(json).unwrap();
|
||||
|
||||
match kind {
|
||||
UpdateKind::MyChatMember(_) => {}
|
||||
_ => panic!("Expected `MyChatMember`"),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue