//! Live smoke test against cn.teamspeak.app. Tagged #[ignore] so
//! `cargo test` does not hit the network by default. Run explicitly
//! with: `cargo test -p chanora_core -- --ignored alpha_smoke`.

#![cfg(test)]

use std::time::Duration;

use chanora_core::{ChanoraSession, ConnectConfig};

#[tokio::test(flavor = "multi_thread", worker_threads = 2)]
#[ignore = "hits the network; run with --ignored"]
async fn alpha_smoke() {
    let s = ChanoraSession::new();
    let cfg = ConnectConfig {
        address: "cn.teamspeak.app".to_string(),
        nickname: "ChanoraAlphaSmoke".to_string(),
        password: None,
        identity: None,
        ready_timeout: Duration::from_secs(15),
    };
    let snap = s.connect(cfg).await.expect("connect");
    println!(
        "snapshot: server='{}' channels={} clients={}",
        snap.server_name,
        snap.channels.len(),
        snap.clients.len()
    );
    assert!(!snap.server_name.is_empty());
    assert!(!snap.channels.is_empty());

    s.disconnect().await.unwrap();
    assert!(!s.is_connected().await);
}
