slacko 0.2.2

Comprehensive Rust SDK for the Slack API with stealth mode support
Documentation
//! Integration tests for RTM API

mod common;

use common::{init, test_client};

#[tokio::test]
async fn test_rtm_connect() {
    init();
    let client = skip_if_no_client!(test_client());

    let result = client.rtm().connect().await;

    match result {
        Ok(response) => {
            println!(
                "✓ rtm.connect: connected as {} ({})",
                response.self_info.name, response.self_info.id
            );
            println!(
                "  WebSocket URL: {}...",
                &response.url[..50.min(response.url.len())]
            );
        }
        Err(e) => {
            // RTM often requires specific scopes or token types
            println!("✓ rtm.connect: {} (may require rtm:stream scope)", e);
        }
    }
}

#[tokio::test]
async fn test_rtm_start_timeout() {
    init();
    let client = skip_if_no_client!(test_client());

    // First check if we can connect at all
    let connect_result = client.rtm().connect().await;

    match connect_result {
        Ok(response) => {
            println!(
                "✓ rtm.start: would connect as {} ({})",
                response.self_info.name, response.self_info.id
            );
            println!("  Note: Not actually starting RTM loop to avoid blocking test");
            // We don't actually call start() here because it blocks indefinitely
            // The connect() test above verifies the API works
        }
        Err(e) => {
            println!("✓ rtm.start: {} (may require rtm:stream scope)", e);
        }
    }
}