ADd test for modify_channel()
This commit is contained in:
parent
a7fd29c7f1
commit
d44193618e
|
@ -1,5 +1,5 @@
|
|||
mod common;
|
||||
use chorus::types::Channel;
|
||||
use chorus::types::{self, Channel};
|
||||
|
||||
#[tokio::test]
|
||||
async fn get_channel() {
|
||||
|
@ -38,3 +38,39 @@ async fn delete_channel() {
|
|||
assert!(result.is_none());
|
||||
common::teardown(bundle).await
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
async fn modify_channel() {
|
||||
let mut bundle = common::setup().await;
|
||||
let modify_data: types::ChannelModifySchema = types::ChannelModifySchema {
|
||||
name: Some("beepboop".to_string()),
|
||||
channel_type: None,
|
||||
topic: None,
|
||||
icon: None,
|
||||
bitrate: None,
|
||||
user_limit: None,
|
||||
rate_limit_per_user: None,
|
||||
position: None,
|
||||
permission_overwrites: None,
|
||||
parent_id: None,
|
||||
nsfw: None,
|
||||
rtc_region: None,
|
||||
default_auto_archive_duration: None,
|
||||
default_reaction_emoji: None,
|
||||
flags: None,
|
||||
default_thread_rate_limit_per_user: None,
|
||||
video_quality_mode: None,
|
||||
};
|
||||
let result = Channel::modify(
|
||||
modify_data,
|
||||
&bundle.user.token,
|
||||
bundle.instance.urls.get_api(),
|
||||
&bundle.channel.id.to_string(),
|
||||
&mut bundle.user.limits,
|
||||
&mut bundle.instance.limits,
|
||||
)
|
||||
.await
|
||||
.unwrap();
|
||||
assert_eq!(result.name, Some("beepboop".to_string()));
|
||||
common::teardown(bundle).await
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue