use opentalk_roomserver_types_livekit::{LiveKitState, MicrophoneRestrictionState};
use pretty_assertions::assert_eq;
mod common;
#[test_log::test(tokio::test)]
async fn livekit_joined_participant_receives_key() {
let (_container, mut room, public_url) = common::build_room().await;
let alice = room.join_alice_moderator(0).await;
let alice_livekit_state = alice
.join_success()
.get_module::<LiveKitState>()
.expect("LiveKit state must be deserializable")
.expect("LiveKit state must be present");
assert_eq!(
alice_livekit_state.microphone_restriction_state,
MicrophoneRestrictionState::Disabled,
);
assert_eq!(
alice_livekit_state.credentials.room,
format!("{}:main", room.id())
);
assert!(!alice_livekit_state.credentials.token.is_empty());
assert!(alice_livekit_state.credentials.service_url.is_none());
assert_eq!(alice_livekit_state.credentials.public_url, public_url);
}