-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: Add test that MUC owners/admins/members with no node are ignored
- Loading branch information
Showing
4 changed files
with
38 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,17 +7,17 @@ use anyhow::Result; | |
use jid::BareJid; | ||
use pretty_assertions::assert_eq; | ||
|
||
use super::helpers::{JoinRoomStrategy, TestClient}; | ||
use crate::{event, recv, room_event, send}; | ||
use itertools::Itertools; | ||
use prose_core_client::domain::shared::models::AnonOccupantId; | ||
use prose_core_client::domain::sidebar::models::BookmarkType; | ||
use prose_core_client::dtos::{ | ||
MucId, ParticipantId, SendMessageRequest, SendMessageRequestBody, UserId, | ||
}; | ||
use prose_core_client::{muc_id, user_id, ClientEvent, ClientRoomEventType}; | ||
use prose_proc_macros::mt_test; | ||
|
||
use crate::{event, recv, room_event, send}; | ||
|
||
use super::helpers::TestClient; | ||
use prose_xmpp::bare; | ||
|
||
#[mt_test] | ||
async fn test_joins_room() -> Result<()> { | ||
|
@@ -27,10 +27,29 @@ async fn test_joins_room() -> Result<()> { | |
.expect_login(user_id!("[email protected]"), "secret") | ||
.await?; | ||
|
||
let strategy = JoinRoomStrategy::default().with_owners([ | ||
bare!("[email protected]"), | ||
// Some rooms may have owners that where the JID doesn't have a node. These should | ||
// be ignored for now. | ||
bare!("prose.org"), | ||
]); | ||
|
||
client | ||
.join_room(muc_id!("[email protected]"), "anon-id") | ||
.join_room_with_strategy(muc_id!("[email protected]"), "anon-id", strategy) | ||
.await?; | ||
|
||
let room = client.get_room(muc_id!("[email protected]")).await; | ||
|
||
assert_eq!( | ||
vec![user_id!("[email protected]"), user_id!("[email protected]")], | ||
room.to_generic_room() | ||
.participants() | ||
.into_iter() | ||
.filter_map(|p| p.user_id) | ||
.sorted() | ||
.collect::<Vec<_>>() | ||
); | ||
|
||
Ok(()) | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -201,7 +201,7 @@ async fn test_joins_room() -> Result<()> { | |
"# | ||
) | ||
}).with_members( | ||
[user_id!("[email protected]")] | ||
[bare!("[email protected]")] | ||
); | ||
|
||
client | ||
|