Add kick member spell

This commit is contained in:
bitfl0wer 2023-08-26 16:22:47 +02:00
parent 6ba2cd4959
commit 22506e8380
No known key found for this signature in database
GPG Key ID: 0ACD574FCF5226CF
1 changed files with 25 additions and 0 deletions

View File

@ -85,3 +85,28 @@ async fn modify_guild() {
assert_eq!(result.name.unwrap(), "Mycoolguild".to_string());
common::teardown(bundle).await
}
#[tokio::test]
async fn guild_remove_member() {
let mut bundle = common::setup().await;
let channel = bundle.channel.read().unwrap().clone();
let mut other_user = bundle.create_user("testuser1312").await;
let user = &mut bundle.user;
let create_channel_invite_schema = CreateChannelInviteSchema::default();
let guild = bundle.guild.read().unwrap().clone();
let invite = user
.create_channel_invite(create_channel_invite_schema, channel.id)
.await
.unwrap();
other_user.accept_invite(&invite.code, None).await.unwrap();
let other_user_id = other_user.object.read().unwrap().id;
Guild::remove_member(guild.id, other_user_id, None, &mut bundle.user)
.await
.unwrap();
assert!(
Guild::remove_member(guild.id, other_user_id, None, &mut bundle.user,)
.await
.is_err()
);
common::teardown(bundle).await
}