forked from lavina/lavina
1
0
Fork 0
This commit is contained in:
Nikita Vilunov 2024-05-21 00:11:23 +02:00
parent dd33b41beb
commit 6491c8819b
2 changed files with 27 additions and 7 deletions

View File

@ -125,7 +125,7 @@ mod tests {
use lavina_core::player::PlayerId; use lavina_core::player::PlayerId;
use proto_xmpp::bind::{Jid, Name, Resource, Server}; use proto_xmpp::bind::{Jid, Name, Resource, Server};
use proto_xmpp::client::Presence; use proto_xmpp::client::Presence;
use proto_xmpp::muc::XUser; use proto_xmpp::muc::{Affiliation, Role, XUser, XUserItem};
#[tokio::test] #[tokio::test]
async fn test_muc_joining() -> Result<()> { async fn test_muc_joining() -> Result<()> {
@ -156,7 +156,17 @@ mod tests {
server: Server(conn.hostname_rooms.clone()), server: Server(conn.hostname_rooms.clone()),
resource: Some(conn.user.xmpp_muc_name.clone()), resource: Some(conn.user.xmpp_muc_name.clone()),
}), }),
custom: vec![XUser], custom: vec![XUser {
item: XUserItem {
affiliation: Affiliation::Member,
role: Role::Participant,
jid: Jid {
name: Some(conn.user.xmpp_name.clone()),
server: Server(conn.hostname.clone()),
resource: Some(conn.user.xmpp_resource.clone()),
},
},
}],
..Default::default() ..Default::default()
}; };
assert_eq!(expected, response); assert_eq!(expected, response);
@ -196,7 +206,17 @@ mod tests {
server: Server(conn.hostname_rooms.clone()), server: Server(conn.hostname_rooms.clone()),
resource: Some(conn.user.xmpp_muc_name.clone()), resource: Some(conn.user.xmpp_muc_name.clone()),
}), }),
custom: vec![XUser], custom: vec![XUser {
item: XUserItem {
affiliation: Affiliation::Member,
role: Role::Participant,
jid: Jid {
name: Some(conn.user.xmpp_name.clone()),
server: Server(conn.hostname.clone()),
resource: Some(conn.user.xmpp_resource.clone()),
},
},
}],
..Default::default() ..Default::default()
}; };
assert_eq!(expected, response); assert_eq!(expected, response);

View File

@ -729,8 +729,8 @@ mod tests {
}), }),
r#type: MessageType::Chat, r#type: MessageType::Chat,
lang: None, lang: None,
subject: Some("daa".into()), subject: Some(Subject(Some("daa".into()))),
body: "bbb".into(), body: Some("bbb".into()),
custom: vec![Ignore], custom: vec![Ignore],
} }
) )
@ -752,8 +752,8 @@ mod tests {
}), }),
r#type: MessageType::Chat, r#type: MessageType::Chat,
lang: None, lang: None,
subject: Some("daa".into()), subject: Some(Subject(Some("daa".into()))),
body: "bbb".into(), body: Some("bbb".into()),
custom: vec![Ignore], custom: vec![Ignore],
} }
) )